Page field, header/footer 
Author Message
 Page field, header/footer

I am using a personnal template build with Word 97.

I built macros to include different footers in my document.  The macro moves
the cursor at the beginning of the document, opens header/footer, goes to
the footer section, inserts an autotext, moves and links sections together
and so on for the number of sections in the document.  The autotext entry is
composed of a logo, a  tab, and the creation date of the document.  This
works o.k.

In the header, I have something as above:

Section 2                                     PAGE 1
CONFIDENTIAL
___________________________________________________________________________

The problem is when the cursor is positioned in the middle of the document
(ex. section 3) and I execute the macro and save immediately, the image of
the footer moves to the header and the page field extends up to the word
CONFIDENTIAL and  the image is of course removed from the footer.

If I close the document without saving, the document is o.k. when I reopen
it.

The problem seems occur only when the Page field in included in the header.

I tried adding the autotext manually, andit does the same thing.

Do you have an idea of what is wrong.

Many thanks for your help.

Josee



Sat, 22 Nov 2003 20:59:01 GMT  
 Page field, header/footer
Hi Jose,

I'm not completely sure I understand exactly what's happening to your
documents, but I know if your macro is a recorded one, that actually opens and
moves through the headers and footers, then it is quite unreliable. It's much
better to work directly with Word's object model when manipulating headers and
footers. More like this:

ActiveDocument.AttachedTemplate.AutoTextEntries("Footer").Insert _
    Where:=ActiveDocment.Sections(1).Footers(wdHeaderFooterPrimary).Range
    RichText:=True

Quote:
> I built macros to include different footers in my document.  The macro moves
> the cursor at the beginning of the document, opens header/footer, goes to
> the footer section, inserts an autotext, moves and links sections together
> and so on for the number of sections in the document.  The autotext entry is
> composed of a logo, a  tab, and the creation date of the document.  This
> works o.k.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

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



Fri, 28 Nov 2003 00:54:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Page Header and Page Footer Problem

2. Page Header and Page Footer disappear

3. First page prints only report header and page footer

4. Page Header/Footer Question

5. Same footer, no header on the 2nd page

6. Header/footer last page

7. Set IE Page header/footer

8. Read/Write Page Header and Footer with VBScript

9. Remove page headers and footers

10. Changing page headers/footers

11. Controlling the header and footer in the page setup of browser control when printing

12. Suppressing Page Headers on Report Footer

 

 
Powered by phpBB® Forum Software