I need to update alot of files and I've set up an AutoText to make it easier to do. How do I make this AutoText entry available to any Word doc or template file so I can easily add it?
I tried putting the AutoText entry in a template in my Startup and used the following code to insert it. It works if I want to add the AutoText entry to a Word doc, but if I try to add it to a Word template, I get a Run-time error '4198' Command Failed and when I hit debug, it goes to the code in red below:
[VBA]
Sub AddMyAT()
Dim strTemplate As String
' Determine what template document is originally attached to
strTemplate = ActiveDocument.AttachedTemplate
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = "c:\program files\microsoft office xp\office10\startup\Cheryl's AT.dot"
.UpdateStylesOnOpen = False
Set rngFind = .Content
End With
ActiveDocument.AttachedTemplate.AutoTextEntries("MyAT").Insert Where:= _
Selection.Range, RichText:=True
End Sub
[/VBA]
What am I doing wrong?
Cheryl