?
Solved

Visual Basic "Error! AutoText Entry not defined" error

Posted on 2009-02-17
2
Medium Priority
?
1,273 Views
Last Modified: 2012-05-06
I have the following code:
.Range.Fields.Add(.Range, Microsoft.Office.Interop.Word.WdFieldType.wdFieldEmpty, "AUTOTEXT  ""Page X of Y"" ", True)

It worked correctly using Word 2002 SP3. However, when creating a Word document to Word 2007, "Error! AutoText Entry not defined" appears instead of "Page 1 of 8", for example.
0
Comment
Question by:msukow
2 Comments
 
LVL 2

Accepted Solution

by:
Skiboy9 earned 2000 total points
ID: 23660525
If all you want to do is add a Page X of Y in the lower left page footer, here is the code to do it.  Let me know if you require more.
    WordBasic.ViewFooterOnly
    ActiveDocument.AttachedTemplate.BuildingBlockEntries("Bold Numbers 1"). _
        Insert Where:=Selection.Range, RichText:=True

Open in new window

0
 

Author Comment

by:msukow
ID: 23671280
Thanks - it will take me about a week to get to this issue - priorities have changed so this is now on the back burner.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question