getting field codes to place properly within a footer 
Author Message
 getting field codes to place properly within a footer

I have a client who will be creating documents in XML using an XML
authoring/publishing tool (Arbortext EpicEditor and Publisher). However,
they have a requirement that they deliver Word files back to some of their
customers. Epic has a tool to convert the XML to Word (uses the template
I've created and basically maps XML elements-in-context to MS Word styles),
but it's not perfect, and I'm left having to clean up a number of pieces.
I'm going to post a number of separate threads for each distinct problem,
but this is the background info, in case it matters.

I have four basic elements that need to be placed in the footer: document
number, revision number, revision date, and Page # of #. Here's my code:

        Set rng = sect.Footers(wdHeaderFooterPrimary).Range
        rng.Text = sDocNum & vbTab & "Page "
        rng.Collapse wdCollapseEnd
        rng.Fields.Add rng, wdFieldPage
        rng.Collapse wdCollapseEnd
        rng.Text = " of "
        rng.Collapse wdCollapseEnd
        rng.Fields.Add rng, wdFieldNumPages
        rng.Collapse wdCollapseEnd
        rng.Text = vbTab & "Date" & "Change"
        rng.Collapse wdCollapseEnd

My output looks like the following:

sDocNum                                  Page   of
DateChange351

I haven't finished the rev date/change info coding yet, so the text is a
placeholder; sDocNum replaces with the document number fine. Note the
center - I get the words Page and of, but the numbers themselves appear at
the far right margin. It should read Page 1 of 35. Not only is it at the
right margin, but reversed (the 35 precedes the 1 for some reason).

Any and all help will be greatly appreciated!

Mary McRae

http://www.*-*-*.com/
http://www.*-*-*.com/
http://www.*-*-*.com/



Tue, 05 Jul 2005 03:12:34 GMT  
 getting field codes to place properly within a footer
fixed it. replaced rng.Collapse wdCollapseEnd with rng.Move wdStory. All is
well.

Mary


Quote:
> I have a client who will be creating documents in XML using an XML
> authoring/publishing tool (Arbortext EpicEditor and Publisher). However,
> they have a requirement that they deliver Word files back to some of their
> customers. Epic has a tool to convert the XML to Word (uses the template
> I've created and basically maps XML elements-in-context to MS Word
styles),
> but it's not perfect, and I'm left having to clean up a number of pieces.
> I'm going to post a number of separate threads for each distinct problem,
> but this is the background info, in case it matters.

> I have four basic elements that need to be placed in the footer: document
> number, revision number, revision date, and Page # of #. Here's my code:

>         Set rng = sect.Footers(wdHeaderFooterPrimary).Range
>         rng.Text = sDocNum & vbTab & "Page "
>         rng.Collapse wdCollapseEnd
>         rng.Fields.Add rng, wdFieldPage
>         rng.Collapse wdCollapseEnd
>         rng.Text = " of "
>         rng.Collapse wdCollapseEnd
>         rng.Fields.Add rng, wdFieldNumPages
>         rng.Collapse wdCollapseEnd
>         rng.Text = vbTab & "Date" & "Change"
>         rng.Collapse wdCollapseEnd

> My output looks like the following:

> sDocNum                                  Page   of
> DateChange351

> I haven't finished the rev date/change info coding yet, so the text is a
> placeholder; sDocNum replaces with the document number fine. Note the
> center - I get the words Page and of, but the numbers themselves appear at
> the far right margin. It should read Page 1 of 35. Not only is it at the
> right margin, but reversed (the 35 precedes the 1 for some reason).

> Any and all help will be greatly appreciated!

> Mary McRae

> http://www.fiberartisan.net
> http://www.quiltingarts.com
> http://www.knockhockey.biz



Wed, 06 Jul 2005 00:55:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Running Excel within IE6 / getting Solver to work properly

2. Change content in a field within a footer

3. Read value from field within footer

4. Getting Merge Field from a Word Document Header and Footer

5. Updating ref field in footer vba code

6. Reading a field and using that field to place a number in another field

7. Macro to place text in a footer with a bookmark

8. Place text at Footer of Word Document

9. Smaller footer can't be placed at the bottom of the page

10. White space in place of suppressed footer

11. coding fields for inclusion within multiple tables

12. Updating a Page Footer from within a Sub-Report

 

 
Powered by phpBB® Forum Software