Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controling MS Word from VFP
Message
De
04/08/1997 12:26:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Controling MS Word from VFP
Divers
Thread ID:
00043068
Message ID:
00043068
Vues:
74
I'm trying to upgrade an application I wrote to send information to MS Word to work better with Office 97. The scant documentation that I found said that I could create a word application object then control it with VB for Applications methods. I use the object browser in MS Word to get the syntax and values for the constants but I can't seem to get some things to work. Here is the code I'm using:

loTest = createobject("word.application")
lodoc = lotest.documents.add("d:\cust\penski\apps32\data\report01.dot")
loTest.visible = .t.

lotest.selection.EndKey(6)
lotest.selection.Font.Size = 12
lotest.Selection.InsertBefore("Date goes here") &&() && DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _False
lotest.Selection.InsertDateTime() &&() && DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _False
loTest.Selection.ParagraphFormat.Alignment = 1 && "wdAlignParagraphCenter"
loTest.Selection.InsertParagraph()
loTest.Selection.ParagraphFormat.Alignment = 0
loTest.Selection.InsertParagraph()

wait window
lotest.activate
wait window
lotest.quit
rele loTest
return

Everything works EXCEPT the "InsertDateTime" command. What I'm really looking for is:
1) A reference for using word in VFP and
2) A header file so I can use their constants instead of the cryptic values.

Anyone have any ideas?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform