insertfile doesn't include footer...

M

Mike Iacovou

hi.

I am trying to insert an RTF document into a document running VBA. I am using:

Selection.InsertFile FileName:=FNameAndPath, Range:="",
ConfirmConversions:=False, Link:=False, Attachment:=False

where FNameAndPath is the full windows path to the file. This inserts the
RTF document exactly, including bookmarks etc. Howeverm it doesn't include
the footer information.
I then tried to simply open the RTF file and copy/paste the wholestory -
again this failed to copy the footer.
I am hoping to be able to change the footer information using VBA (and had
achieved this using a bookmark in the footer)... but as the bookmark / footer
insn't being included, this is now failing ?
Any means of either:
1. including an RTF including FOOTER or,
2. accessing FOOTER text via VBA

TIA
 
A

Anne Troy

To my knowledge, RTF means Rich Text Format, and doesn't include headers,
footers, or bookmarks. To wit, save a file as RTF and open with WordPad.
************
Anne Troy
www.OfficeArticles.com
 
M

Mike Iacovou

thanks anne.
i have some RTF documents that include footers... and to that end even have
bookmarks within the footer when opened in word... so those control codes
seem to be supported.

mike
 
M

Mike Iacovou

that won't help me with the problems at hand (no footers in wordpad). thanks
anyway :)
 
A

Anne Troy

Sorry, Mike. I understand that and I'm trying to get you to understand that
RTF files do not have headers, footers, and bookmarks. The only reason you
still see them is because you're opening them in Word and, to my knowledge,
that IS the only way you'll get them. That's why your automation isn't
working. Change the RTFs to Word docs and your automation should work fine.
************
Anne Troy
www.OfficeArticles.com
 
M

Mike Iacovou

that's just it... even as a word document, it doesn't work. if i open the
file, the footer is there - but when i insert the file using insertfile, the
footers' are gone.
Once again, i use:

Selection.Collapse Direction:=wdCollapseEnd
Selection.InsertFile FileName:=FNameAndPath, Range:="",
ConfirmConversions:=False, Link:=False, Attachment:=False

TIA
 
A

Anne Troy

Okay, I see. So what is happening is this... when you want the footer from a
new document to come in (I'm no coder but did manage just such a project),
you have to (manually) go to the end of the existing document. View the
header and footer and turn OFF same as previous (Link to previous in 2003).
You may also have to turn this off in the doc you're inserting, which as I
recall we weren't able to accomplish since there is no "previous" before you
insert it and after you insert it, it's too late, but try anyway. Your
inserted document is taking on the footers of the document into which you're
inserting because of the same as (link to) previous setting. Some of the
information here might help:
http://www.officearticles.com/word/understanding_section_breaks_in_microsoft_word.htm
Let me know if you have any more questions, tho. I'll do what I can to help.
************
Anne Troy
www.OfficeArticles.com
 
C

Charles Kenyon

Headers and footers are a part of section formatting. You need to be
bringing in the section mark at the end.
http://word.mvps.org/FAQs/Formatting/WorkWithSections.htm
http://word.mvps.org/FAQs/Formatting/PasteWithoutSectionInfo.htm

You may need to modify your source document by inserting a continuous
section break at the end.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
A

Anne Troy

Thank you, Charles, because now that you mention it, that's EXACTLY what we
did. Then, once you've inserted all the files, you go to the last section,
make it SAME as previous, then delete that extra section break. (All this
with code of course.) But that'll only work if there was no different first
page or different odd and even setups. Mike, if you think it'd be helpful to
see the code for this, email me. It was paid for, and there's pages of it,
so I'm not hot to post it in the open.
************
Anne Troy
www.OfficeArticles.com
 

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