printing with word in .Net application

  • Thread starter Thread starter steven
  • Start date Start date
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
 
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
 
Back
Top