Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2005, 09:35 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default print .doc file using Office Solutions Development

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. Language used is Visual Basic .NET.

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.wdPrintDocumentConte nt, _
             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/de...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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help need to geneate word doc in open office satyakishore Servlets 0 March 16th, 2006 04:14 AM
Print .doc file from the website using System.Diag appleLover General .NET 0 February 17th, 2005 08:39 PM
Code for Pro PHP4 Web Development Solutions Kit Wrox Book Feedback 4 August 22nd, 2004 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.