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
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