print .doc file using Office Solutions Development


New member
Feb 17, 2005
Programming Experience
Hi all,

I'm currently doing a project that allows the user to print doc file from mobile web application. It means that the user can print doc file while they are on the move.

My project is using mobile web application. I had made the enumeration of printer to allow the user to select the printer they want their document print to. I'm using the Microsoft Word 1.0 Object Library, which I add reference from the COM, to print doc file.

Here are some of my code that called the Microsoft Word to print doc file for me:

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
		Dim wordapp As New Word.Application
		Dim docPolicy As Word.Document
		docPolicy = wordapp.Documents.Open("C:\TestPrinting.doc")
		wordapp.PrintOut( _
			Background:=True, _
			  Append:=False, _
			  Range:=Word.WdPrintOutRange.wdPrintAllDocument, _
			  Item:=Word.WdPrintOutItem.wdPrintDocumentContent, _
			  Copies:=1, _
			  Pages:=1, _
			  PageType:=Word.WdPrintOutPages.wdPrintAllPages, _
			  PrintToFile:=False, _
			  Collate:=True, _
End Sub
However, there is an error. It said that my wordap.PrintOut(...) Type Mismatch. I get this code from the msdn:
Could u please help me in solving this problem?

Another problem is that I want to allow the user to select the printer they want to print to. How can I call the selected printer to print the document?

If u see this thread, please replied to me. I need ur help greatly. I hope that u can replied as soon as possible. Your help is greatly appreciated.

Top Bottom