Article ID: 153675
Article Last Modified on 10/15/2003
105714 Document Object Margins Default to Zero Inches
121049 Wrong Page Size for Word Document Object Opened to Edit
CREATE TABLE myword (wordfld G)
APPEND BLANK
APPEND GENERAL wordfld CLASS "Word.Document"
** The above lines are for demonstration only
** Normally the table will already exist and contain the document
frmDummy = CREATEOBJECT("Form")
frmDummy.ADDOBJECT("objWordDoc","OleBoundControl")
frmDummy.objWordDoc.ControlSource = "wordfld"
frmDummy.objWordDoc.DoVerb(1) &&starts an instance of Word
objWordInst = GETOBJECT("","Word.Basic") &&create a reference to Word
** set paper size - see Q121049 referenced above
objWordInst.FilePageSetup(,,"1","1",,"1","1","8.5 in","11 in")
objWordInst.Insert("Brown Shoes Don't Make It")
objWordInst.AppHide
objWordInst.FilePrint
WAIT WINDOW "Printing document" TIMEOUT 5
objWordInst.AppClose
RELEASE objWordInst
Additional query words: VFoxWin OLE automation winword
Keywords: kbcode KB153675