Re: Adding Page ? of ?? to footer

From: Charles Kenyon (msnewsgroup_at_remove.no.spam.addbalance.com)
Date: 03/15/04


Date: Mon, 15 Mar 2004 09:14:16 -0600

Hi Joe,

I recorded/wrote the code in a temporary file and abandoned it when I saw
that Dave Lett had sent you something. He is a far more experienced
programmer than am I. Did you try the code he sent you?

-- 
Charles Kenyon
See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
 --------- --------- --------- --------- --------- ---------
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.
"Joe" <anonymous@discussions.microsoft.com> wrote in message
news:59D2D3DE-11D5-481D-9937-C140058FDF13@microsoft.com...
> Charles,
>
> If you would be willing to send your code, I would apprecaite it.
>
> Thanks,
>
> Joe
>
>      ----- Charles Kenyon wrote: -----
>
>      I couldn't get your code to work on my machine at first, because I've
>      stripped normal.dot of its AutoText entries including Page X of Y.
(They are
>      in a different global.) When I put it back in, it didn't even give me
the
>      same results as you are getting but did put both of them at the end.
>
>      It occurs to me that you have too many tabs. The header and footer
styles
>      each have two tab settings so you may be pushing something off your
page.
>
>      I had some code that I have worked on but you already have a
solution. Look
>      into the tabs, though.
>      -- 
>
>      Charles Kenyon
>
>      See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
>       --------- --------- --------- --------- --------- ---------
>      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.
>
>
>      "Joe" <anonymous@discussions.microsoft.com> wrote in message
>      news:E31860D9-79C0-45DA-A3D1-3EA46D8546EC@microsoft.com...
>      > I am using the following n Word 2002 VBA code to format the footer
as
>      follows:
>      >> March 12, 2004                                Page 2 of 4
>      Workbook Verion 1.0
>      >>     With wd
>      >         With .ActiveDocument.Sections(1)
>      >             Set oRngFoot = .Footers(wdHeaderFooterPrimary).Range
>      >             With oRngFoot
>      >                 .Text = "Date: " & Format(Date, "mmmm d, yyyy") &
vbTab &
>      vbTab
>      >                 .Collapse Direction:=wdCollapseEnd
>      >             End With
>      >>
.Parent.ActiveDocument.AttachedTemplate.AutoTextEntries("Page
>      X of Y").Insert Where:=oRngFoot
>      >>             With oRngFoot
>      >                 .Collapse Direction:=wdCollapseEnd
>      >                 .Text = vbTab & vbTab & "Work*** Version 1.0"
>      >             End With
>      >         End With
>      >     End With
>      >> Instead, I'm getting this:
>      >> March 12, 2004
>      Workbook Verion 1.0Page 2 of 4
>      >> Does anyone know why?
>      >> I am not familiar with the Collapse method and why it is used.
>      >> Any help would be greatly appreciated.
>      >> Also, can anyone recommend a good Word VBA book?  The object model
is hard
>      for me to follow.
>      >> Thanks,
>      >> Joe
>      >