Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Word 97 Ole Automation Commands in Visual Fox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00085204
Message ID:
00085364
Vues:
33
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform