Print Word Document whole doc

I would like to print whole document using C# code.
LVL 13
AshokAsked:
Who is Participating?
 
Shahan AyyubSenior Software Engineer - iOSCommented:
Sorry for the late reply.

In your previous question you said that 'your code prints the whole document'. So it would be enough to print a whole document. Isn't it ???


MoreOver you can write like this (r replace the print function as) :


object printInBG = true;
            object copies = "1";
            object range = Word.WdPrintOutRange.wdPrintAllDocument;
            object items = Word.WdPrintOutItem.wdPrintDocumentContent;
            object pageType = Word.WdPrintOutPages.wdPrintAllPages;
            object oTrue = true;
            object oFalse = false;

            WordDoc.PrintOut(ref printInBG, ref missing, ref missing,
                             ref missing, ref missing, ref missing,
                             ref items, ref copies, ref missing,
                             ref pageType, ref missing, ref missing,
                             ref missing, ref missing, ref missing,
                             ref missing, ref missing, ref missing);

Open in new window

0
 
Shahan AyyubSenior Software Engineer - iOSCommented:
Kindly mention two things:

1) Using COM ???
2) In VS2005 or 2008 ???
0
 
AshokAuthor Commented:
VS 2008

Microsoft.Office.Interop.Word

Ashok
0
 
Shahan AyyubSenior Software Engineer - iOSCommented:
In the 2nd 'ref missing' replace it with 'ref range'.

Range should be specify their which is set to 'wdPrintAllDocument'.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.