Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Control of Word 97
Message
From
12/06/1997 04:05:28
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00036000
Message ID:
00036056
Views:
51
>>>** these four lines work fine
>>>ox=createobject('word.document')
>>>ox.application.documents.open(thisfile) && thisfile=desired file surrounded by quotes
>>>ox.application.visible=.t.
>>>ox.application.activedocument.printpreview
>>>
>>>** this one doesn't, although the help states that this is the correct syntax
>>>ox.application.activedocument.printout

>>When I get the printing piece to work, I'll put that it also.

Hello Rick

concerning work printout method, I have no definitive answer.
But I have spent long hours with EXCEL and ... in the end all my OLE
automation commands worked as documented.

In most cases Excel requires ALL PARAMETERS to be passed to the ole engine.
Possibly the same applies to Winword.

if "ox.application.activedocument.printout" does not work, you should
investigate sending all appropriate parameters to the Winword engine which requires (under VBA) :

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False

That should translate into something looking roughly like:

ox.activedocument.PrintOut("",wdPrintAllDocument,wdPrintDocumentContent,
0,"",wdPrintAllPages,.T.,.T.,.F.)

where wdPrintAllDocument,wdPrintDocumentContent,wdPrintAllPages are VBA
constants (should be in some VBA Winword documentation.

My short test in Paris has been successfull. I have no access to VBA Winword
documentation here, i do know neither exact type nor value (numeric) of
those constants.

Keep us informed

François
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform