Word 2002 PrintOut method fails

M

MartinT

Have anyone seen what happens if the following code is run under Word
10.0 (Office 2002) library? There is no problem under Office 2000 or
2003. Do we have a bug or I'm goin' mad?

To run this code create new std exe project in VB6. Form1 is created
by default. Add reference to Word library then add a component named
Microsoft Internet Controls and put a Web Browser on the form as well
as a button.

Private Sub Form_Load()
WebBrowser1.Navigate "C:\AnyWordDocument.doc"
End Sub
Private Sub Command1_Click
Dim doc as Word.Document
Set doc = WebBrowser1.Document
doc.PrintOut
End Sub

When calling PrintOut method you receive an exception with the message
"Method PrintOut of object _document failed", that's it. How to print
a document then?

Martin Tucker
 
Top