Article ID: 138205
Article Last Modified on 2/24/2005
Contact
Company
Phone
Dear greeting,
<This is the body of the form letter.>
Sincerely,
<Your Company Name>
Create bookmarks for Contact, Company, Phone, and greeting.
PUBLIC oWordObj, ver_info
ver_info=IIF("06."$VERSION(),6,5)
IF ver_info=6
OPEN DATA home(2)+"data\TestData.dbc"
else
OPEN DATA SYS(2004)+"\samples\data\TestData.dbc"
endif
USE Customer
oWordObj=CREATEOBJECT("Word.Basic")
IF ver_info=6
oWordObj.FileOpen (home(2)+"data\wordole.doc")
ELSE
oWordObj.FileOpen (SYS(2004)+"samples\data\wordole.doc")
ENDIF
oWordObj.EditGoto ("contact")
oWordObj.Insert (Customer.Contact)
oWordObj.EditGoTo ("company")
oWordObj.Insert (Customer.Company)
oWordObj.EditGoTo ("phone")
oWordObj.Insert (Customer.Phone)
oWordObj.EditGoTo ("greeting")
oWordObj.Insert (Customer.Contact)
oWordObj.FilePrint
PUBLIC oWordObj, ver_info
ver_info=IIF("06."$VERSION(),6,5)
IF ver_info=6
OPEN DATA home(2)+"data\TestData.dbc"
else
OPEN DATA SYS(2004)+"\samples\data\TestData.dbc"
endif
USE Customer
oWordObj=CREATEOBJECT("Word.Basic")
IF ver_info=6
oWordObj.FileOpen (home(2)+"data\wordole.doc")
ELSE
oWordObj.FileOpen (SYS(2004)+"samples\data\wordole.doc")
ENDIF
oWordObj.ww7_EditGoto ("contact")
oWordObj.Insert (Customer.Contact)
oWordObj. ww7_EditGoTo ("company")
oWordObj.Insert (Customer.Company)
oWordObj. ww7_EditGoTo ("phone")
oWordObj.Insert (Customer.Phone)
oWordObj. ww7_EditGoTo ("greeting")
oWordObj.Insert (Customer.Contact)
oWordObj.FilePrint
Keywords: kbhowto kbinterop kbautomation kbcode KB138205