Select All including Footer

J

John

Hi,

I want to be able to copy the entire contents including the footer detail to
a new document using VBA. I have unlinked the footer fields, but still have
trouble selecting the whole document including the footer.
Activedocument.Select doesn't select the footer.
Do I have to actually select the footer separately and paste it in the new
document as well?

Thanks,

John
 
P

Peter Hewett

Hi John

You can't select the "entire" document in one go!

A Word document consists of a series of Stories, these can be accessed through a Documents
StoryRange object. There is one StoryRange object for the main document body text
(wdMainTextStory). But there can be up to 3 different Headers and Footers (yes 6 in
total) per Section of your document!

This is actually becomes quite complex and tricky. I'd do this the easy way and create a
new document from the current document (or the document you want to copy if it's not the
current document). You may need to save the document first though.

HTH + Cheers - Peter
 
C

Cindy M -WordMVP-

Hi John,

I take it this works for you when you do it "manually"? Indeed, it behaves
differently in the VBA interface - the contents of last paragraph mark are
usually left out. You might try imitating the actions in the UI, though:

WordBasic.editselectall
WordBasic.Editcopy

I want to be able to copy the entire contents including the footer detail to
a new document using VBA. I have unlinked the footer fields, but still have
trouble selecting the whole document including the footer.
Activedocument.Select doesn't select the footer.
Do I have to actually select the footer separately and paste it in the new
document as well?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
J

John

Thank you both for your answers.

Cindy M -WordMVP- said:
Hi John,

I take it this works for you when you do it "manually"? Indeed, it behaves
differently in the VBA interface - the contents of last paragraph mark are
usually left out. You might try imitating the actions in the UI, though:

WordBasic.editselectall
WordBasic.Editcopy



Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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