Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Word 97 Ole Automation Commands in Visual Fox
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00085204
Message ID:
00085364
Views:
34
>OWord = CreateObject("word.basic.8")
>OWord.FileNew()
>OWord.Insert("This is the non-bolded text")
>OWord.selection.font.bold = .T.
>OWord.Insert("This is the bolded text")


Hi Ben,

In Word 97, you do not need to use Word.Basic - which is somewhat kludgy. Rather, Word 97 finally has a real object model. Try this instead

oWord = CreateObject("word.application")
oword.visible = .t.
oWord.Documents.Add

With oWord.Selection
.Font.Bold = .T.
.TypeText("This is bolded text")
.TypeParagraph
.Font.Bold = .F.
.TypeText("this is non-bolded text")
.TypeParagraph
EndWith
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform