>>>** 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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement