I assume you want to do this from VB 5 or 6. <br>
Make sure to add the MS Word object library to your references. <br>
<br>
With the object library included, you should be able to add text and manipulate formatting as if you were in the Word. <br>
<br>
Here is an example:<br>
<br>
Option Explicit<br>
<br>
Dim wdApp As Object<br>
Dim wdDoc As Object<br>
<br>
Private Sub main()<br>
Set wdApp = CreateObject("Word.Application"

<br>
wdApp.Visible = False 'this will keep word hidden<br>
<br>
Set wdDoc = wdApp.Documents.Add<br>
<br>
With wdApp.Selection<br>
.TypeText Text:="This is normal text"<br>
.TypeParagraph<br>
.Font.Bold = wdToggle<br>
.TypeText Text:="This is bold text"<br>
.TypeParagraph<br>
.Font.Italic = wdToggle<br>
.Font.Bold = wdToggle<br>
.TypeText Text:="This is italic"<br>
.TypeParagraph<br>
.Font.Italic = wdToggle<br>
.Font.Name = "Arial"<br>
.Font.Size = 14<br>
.TypeText Text:="This is Arial 14 instead of Times 12"<br>
.TypeParagraph<br>
End With<br>
<br>
wdDoc.SaveAs FileName:="D:\temp\Sample.doc"<br>
<br>
wdApp.Quit ' When you finish, use the Quit method to close<br>
Set wdDoc = Nothing<br>
Set wdApp = Nothing<br>
End<br>
End Sub<br>
<br>