Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controling MS Word from VFP
Message
From
04/08/1997 12:26:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Controling MS Word from VFP
Miscellaneous
Thread ID:
00043068
Message ID:
00043068
Views:
76
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?
Next
Reply
Map
View

Click here to load this message in the networking platform