MgtHargreaves
Programmer
I have an interesting problem which one of our users brought to my attention - using automation to create and print a Word document. Having created and printed the Word document, if we then open an excel document (normally, not using vfp) and try to print the document, there is nothing in the printer name box. The code is as follows:
I have established that the printer name box in Excel goes blank after the oWord.ActivePrinter = GETPRINTER() line.
Any-one got any ideas as to what is happening?
Code:
oWord=CREATEOBJECT("Word.Application")
oWord.Documents.Add("C:/xxxx/yyy.dot")
oWord.ActivePrinter = GETPRINTER()
oWord.printout(0)
oWord.ActiveDocument.Close(0)
Any-one got any ideas as to what is happening?