printing with word in .Net application

S

steven

Hello,

In my .net application, I use word templates for printing. I
programmatorically fill in the template, and add it to word, then I
print the word document.

However, I always get the message:

The margins of section x are set outside the printable area of the page.
Do you want to continue?

This is my code:


pd.PrinterSettings = New System.Drawing.Printing.PrinterSettings
pd.ShowDialog()

myword.ActivePrinter = pd.PrinterSettings.PrinterName
myword.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone


'this line is causing the error:
myword.ActiveDocument.PrintOut(, , , , , , , pd.PrinterSettings.Copies)


I can 't get rid of this message. Any help?

Many thanks,

Steven
 
T

Teemu

steven said:
Hello,

In my .net application, I use word templates for printing. I
programmatorically fill in the template, and add it to word, then I print
the word document.

However, I always get the message:

The margins of section x are set outside the printable area of the page.
Do you want to continue?

This has nothing to do with VB. It means that the document's marginals are
too narrow for selected printer. Open the template with Word and adjust
marginals. You'll get the same error message if settings are not correct
assuming the same printer is selected.

-Teemu
 

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