Re: MS Word and Printing
From: Peter Hewett (Nospam_at_xtra.co.nz)
Date: 02/11/04
- Next message: KC: "Re: Event log property doesn't retain setting changes.."
- Previous message: Rick: "Re: Adding Scanning Capabilities to a VB.Net App"
- In reply to: scorpion53061: "MS Word and Printing"
- Next in thread: Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS: "Re: MS Word and Printing"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Feb 2004 11:55:29 -0800
Hi 53061
If the code you've posted is what you're executing you've got a problem
sure enough. The statement:
oDoc.Application.Dialogs.Item(wdDialogFileSaveAs)
is invalid! And since it's outside your Try block the Catch exception
handler is not grabbing it! Try using:
oDoc.Application.Dialogs.Item(wdDialogFileSaveAs).Show
or if you have the Word applicat object rather than the document object
use:
wdApp.Dialogs.Item(wdDialogFileSaveAs).Show
HTH + Cheers - Peter
"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
news:#Ln$3BM8DHA.2656@TK2MSFTNGP11.phx.gbl:
> I have my Word document being created in a seperate thread. THe
> applicaiton is not visible.
>
> The end user can choose to view the document upon completion or just
> have it print.
>
> Viewing is fine.
>
> If htey choose to "just print it" it seems ot ignore this command:
>
> oDoc.Application.Dialogs.Item(wdDialogFileSaveAs)
>
> and a prompt appears asking that it wait until printing is complete. I
> beleive it is because it is getting to my "kill thread" command at that
> point.
>
> In addition when I ask that it cancel the print job in the Word dialog
> that appears, something like a print preview screen appears. (I use MS
> Word 2003). Then the save file dialog appears
>
> Is there a way to just offer to save it, print it, and kill the thread
> without this inteference from Word? I am probably missing something
> here.
>
> I need this to work with Office 2000 and up.....
>
> oDoc.Application.Dialogs.Item(wdDialogFileSaveAs)
>
>
> OfficeThread.IsBackground = False
> oDoc.Application.Dialogs.Item(wdDialogFileSaveAs)
> Try
> OfficeThread.IsBackground = True
> Label28.Text = "Printing Report..."
> Label28.Refresh()
> OfficeThread.IsBackground = False
> oDoc.Application.PrintOut()
> OfficeThread.IsBackground = True
> oDoc.Application.Quit()
> OfficeThread.Abort()
>
>
>
- Next message: KC: "Re: Event log property doesn't retain setting changes.."
- Previous message: Rick: "Re: Adding Scanning Capabilities to a VB.Net App"
- In reply to: scorpion53061: "MS Word and Printing"
- Next in thread: Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS: "Re: MS Word and Printing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|