howto copy pagesetup

N

Nikhil Patel

Hi all,
I need to append contents of one document to another programmatically. I
am able to do it using the FormattedText property. But I need to also copy
the PageSetup along with the FormattedText. How can I do this?

Thanks.
-Nikhil
 
D

Dave Lett

Hi Nikhil,

You can use the following to amend your current routine:

Dim oDocFrom As Document
Dim oDocTo As Document

'''open each document
Set oDocFrom = Documents.Open(FileName:="Enter the name/path of the document
you want to append.")
Set oDocTo = Documents.Open(FileName:="Enter the name/path of the document
you want to append to.")
'''use whatever code to append the formattedtext
'''of oDocFrom to oDocTo

'''copy the .PageSetup properties
With oDocTo.PageSetup
.BottomMargin = oDocFrom.PageSetup.BottomMargin
.TopMargin = oDocFrom.PageSetup.TopMargin
'''add any other properties you want
End With

HTH,
Dave
 

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