Jump to Real's How-to Main page

Print a Word document

oleObject ole_1
string ls_result
ole_1 = CREATE OLEObject
ole_1.ConnectToNewObject("word.application")
ole_1.documents.open("C:\realhowto.doc")
ole_1.selection.typetext(ls_result)
ole_1.activedocument.PrintOut(FALSE)
ole_1.activedocument.PrintOut()
ole_1.activedocument.close(0) 
ole_1.quit()
ole_1.disconnectObject()
DESTROY ole_1

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]