Word 2003, number of copies problem

S

Sparre

Hello

I have an application that prints out different documents, I use the
"wdDialogFilePrint" and call the Display method. This is because I
need to print out several documents with the same settings and don't
want to show the dialog for every document.

But when, in the dialog, I choose to print out more than one document,
it only prints one. Why is this the case. I remembers the chosen
printer, but not the number of copies.

Is it possible to manually get the number of Copies?

http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.word.wdworddialog(VS.80).aspx
discribes the following "fields" for the "wdDialogFilePrint"

"Background, AppendPrFile, Range, PrToFileName, From, To, Type,
NumCopies, Pages, Order, PrintToFile, Collate, FileName, Printer,
OutputPrinter, DuplexPrint, PrintZoomColumn, PrintZoomRow,
PrintZoomPaperWidth, PrintZoomPaperHeight, ZoomPaper"

How do I access the NumCopies "property" ? So I can manually print out
the chosen number of copies..
 
C

Cindy M.

Hi Sparre,
I have an application that prints out different documents, I use the
"wdDialogFilePrint" and call the Display method. This is because I
need to print out several documents with the same settings and don't
want to show the dialog for every document.

But when, in the dialog, I choose to print out more than one document,
it only prints one. Why is this the case. I remembers the chosen
printer, but not the number of copies.
When you use the Display method Word uses nothing in the dialog box. You
have to capture the information you need and pass it to the PrintOut
method. Or you "roll your own" dialog box.

Since the dialog box arguments are all late-bound properties, how simple
it is for you to pick them up depends on which programming language
you're using? And if it's VB.NET, what's your Option Strict setting?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
S

Sparre

When you use the Display method Word uses nothing in the dialog box. You
have to capture the information you need and pass it to the PrintOut
method. Or you "roll your own" dialog box.

How do I capture those settings ?
Since the dialog box arguments are all late-bound properties, how simple
it is for you to pick them up depends on which programming language
you're using? And if it's VB.NET, what's your Option Strict setting?

I use C#

VB is just gibberish to me :eek:)
 
C

Cindy M.

Hi Sparre,
How do I capture those settings ?


I use C#

VB is just gibberish to me :eek:)
Here's an example that pre-sets the property for the number of copies,
displays (but does not execute) the FilePrint dialog box, then shows the
number of copies the user selected.

Word.Dialog dlgPrint =
wdApp.Dialogs[Word.WdWordDialog.wdDialogFilePrint];
object[] dlgParamsPrint = new object[] { 2 };
dlgPrint.GetType().InvokeMember("NumCopies",
BindingFlags.SetProperty, null,
dlgPrint, dlgParamsPrint);
dlgPrint.Display(ref missing);

object copies =
dlgPrint.GetType().InvokeMember("NumCopies", BindingFlags.GetProperty,
null, dlgPrint, null);
if (copies != null)
MessageBox.Show(String.Format("Copies: {0}", copies));



Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top