print .doc file using Office Solutions Development

appleLover

New member
Joined
Feb 17, 2005
Messages
2
Programming Experience
1-3
Hi all,

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

My project is using asp.net 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:

VB.NET:
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, _
			  ManualDuplexPrint:=False)
End Sub

However, there is an error. It said that my wordap.PrintOut(...) Type Mismatch. I get this code from the msdn:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/WordObject.asp
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.

Thanks.
 
Back
Top