Log in

View Full Version : Inserting AutoText entry from created template



phrankndonna
12-30-2011, 08:29 AM
Hi,

I'm working with MS Word 2003. I've got a template I've taken over called OutlineFormatter. It works fine, but it reaches in to the Normal template to use an AutoText entry called "PropHeader". I've copied that same AutoText entry into the OutlineFormatter.dot template so I can keep this all self-contained, which will make it easier to distribute to users, but the modified code is erroring out.

The current code is this:

NormalTemplate.AutoTextEntries("PropHeader").Insert Where:=Selection.Range, RichText:=True

I've modified it to look at the OutlineFormatter.dot template (which i confirmed via Tools>Templates and Add-Ins that it is attached), and the modified code is below, but it is returning a RunTime error message (#5941, "The requested memeber of the collection does not exist").

ActiveDocument.AttachedTemplate.AutoTextEntries("PropHeader").Insert Where:=Selection.Range, RichText:=True

It seems I should be able to do this. Why would this be erroring out like this? Thanks for any input and advice. Happy New Year!

Frank

fumei
01-06-2012, 08:54 PM
A template listed as an Add-in is NOT the AttachedTemplate.

fumei
01-06-2012, 08:54 PM
A template listed as an Add-in is NOT the AttachedTemplate.

fumei
01-06-2012, 08:54 PM
A template listed as an Add-in is NOT the AttachedTemplate.

phrankndonna
01-07-2012, 09:40 PM
What would be the attached template? Basically, how can I make this all self-contained? I want to be able to distribute this template to multiple computers that users remotely access. As it stands right now, before they can use this template, they have to open a separate/special 'normal' template and copy this autotext entry (PropHeader) into their own Normal template (via the Organizer). I've tried to save it in this OutlineFormatter.dot template, but the macro stalls at this point in the code. Thanks for taking the time to consider this issue. I greatly appreciate it.

Frank