Print Word Document whole doc

I would like to print whole document using C# code.
LVL 13
AshokSr. Software EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shahan AyyubSenior Software EngineerCommented:
Kindly mention two things:

1) Using COM ???
2) In VS2005 or 2008 ???
0
AshokSr. Software EngineerAuthor Commented:
VS 2008

Microsoft.Office.Interop.Word

Ashok
0
Shahan AyyubSenior Software EngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shahan AyyubSenior Software EngineerCommented:
In the 2nd 'ref missing' replace it with 'ref range'.

Range should be specify their which is set to 'wdPrintAllDocument'.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.