AutotextEntries for word 2007 and 2003

N

Nan

I have an Autotextentry "Page x of y" in my vba script in one of my template
as ‘NormalTemplate.AutoTextEntries("Page X of Y").Insert Where:=Selection.
Range, RichText:=True’,
this works fine in word 2003 but not in 2007, so I changed the script
accordingly to work for 2007 as
Templates(“Building Blocks.dotxâ€).BuildingBlockEntries("Bold Numbers").
Insert Where:=Selection.Range, RichText:=True
Which is working fine in 2007 (offcourse not in 2003). As my clients are
still in a migration process to office 2007 some are still having word 2003.
I need to update the script so that it works for both word 2003 and 2007. I
Had no luck in finding the solution for this, any help is greatly
appreciated

Thanks in advance.
Nan
 
S

Suzanne S. Barnhill

Is there some reason you're not just putting Page X of Y in the
header/footer of the template itself?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
N

Nan

Added an autotext entry "Page X of Y" into my document template(dot), and
changed the script to ActiveDocument.AttachedTemplate.AutoTextEntries("Page x
of y").Insert _
Where:=Selection.Range, RichText:=True
It is working fine for both the versions 2003 and 2007.

Thanks,
Nan
 
G

Graham Mayor

I think you are missing the point. If you put the field in the footer of the
template, you don't need the macro.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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