this is some older code, I think from some Word97 stuff I did but it still works....
It uses bookmarks and replaces them with default text.
oWord = CreateObject("word.Application") IF Vartype(oWord) = "O" oWord.Visible = .T. oWord.Open(your document name here) WITH oWord.Basic IF .ExistingBookmark("certification") = -1 && make sure the boomark exists .WW7_EditGoTo("certification") && goto the bookmark .FormFieldOptions(,,,,,,ALLTRIM(m.lcCertification)) && fill in the formfield .EnableFormField("certification",1) && disable the formfield ENDIF ENDWITH ENDIF
I am sure by now there is more elegant code to do this but hey.... if it aint broke don't fix it right.
I don't don't have the Word Automation book maybe you can let me know if there is an updated way of doing this.
sorry I couldn't be more help
-----Original Message----- From: profox-admin /at/ leafe D.O.T com [mailto:profox-admin@leafe.com] On Behalf Of Shawn Dorion Sent: Friday, January 31, 2003 4:56 PM To: profox /at/ leafe D.O.T com Subject: RE: Word Document - VFP - Filling the Blanks
it's locating an replacing that I need the actual creation of the Word Object I have down pat.
Thanks Anyways.
Shawn Dorion Senior Developer mailto:shawn@oursoftware.com <mailto:shawn /at/ oursoftware D.O.T com>
http://www.oursoftware.com/ <http://www.oursoftware.com/> "Innovators in Public Safety Scheduling and Time and Attendance Management"
-----Original Message----- From: profox-admin@leafe.com [mailto:profox-admin /at/ leafe D.O.T com]On Behalf Of Eugene Vital Sent: Friday, January 31, 2003 4:42 PM To: profox@leafe.com Subject: RE: Word Document - VFP - Filling the Blanks
you can download a CHM version of the book from the website untill you get yours back
in the meantime you can start with
oWord = CreateObject("word.Application") IF Vartype(oWord) = "O" oWord.Visible = .T. oWord.Open(your document name here) ENDIF
you can look in the Word help files to find the specific functions you need.
hth........
-----Original Message----- From: profox-admin /at/ leafe D.O.T com [mailto:profox-admin@leafe.com] On Behalf Of Shawn Dorion Sent: Friday, January 31, 2003 4:28 PM To: Profox Subject: Word Document - VFP - Filling the Blanks
Okay Guys & Gals, I know how to open word with VFP 7. What I need to do is Fill in a contract programmatically from a table in VFP.
I.e. Customer Name : _____________________________ I need to file this box in with the underling there. I must keep all formatting as this is a legal document.
Thanks for any tips, I have bought Office Automation from Whil's company, but someone at our office wanted a personal copy and now it seems to be missed placed??? :-(
Thanks Again! Shawn Dorion Senior Developer mailto:shawn /at/ oursoftware D.O.T com
http://www.oursoftware.com/ "Innovators in Public Safety Scheduling and Time and Attendance Management"
[excessive quoting removed by server]
©2003 Eugene Vital |