How to set the page layout in c# program?

V

vincent

How to set the page layout?
I would like to know how to set the "size" and "margin".
Many thanks for your replying.
 
D

Doug Robbins - Word MVP

You need to get your c# program to access the Word Object Model and then you
can made use of all of its features.

With ActiveDocument.PageSetup
.PaperSize = wdPaperA4
.TopMargin = 72 'points = 1 inch
.LeftMargin = 72
.RightMargin = 72
.BottomMargin = 72
End With

I can't help you with the c# end of it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
V

vincent

Wow! That is very very cool. Thank you.

Doug Robbins - Word MVP said:
You need to get your c# program to access the Word Object Model and then you
can made use of all of its features.

With ActiveDocument.PageSetup
.PaperSize = wdPaperA4
.TopMargin = 72 'points = 1 inch
.LeftMargin = 72
.RightMargin = 72
.BottomMargin = 72
End With

I can't help you with the c# end of it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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