Experts Exchange connects you with the people and services you need so you can get back to work.
'Function to replace a Microsoft Word autotext entry
'Takes the template location, old and new entries as parameters
Function AutoTextReplace(strTemplate, strOldEntry, strNewEntry)
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open(strTemplate, False)
Set objTxtEntry = objWord.NormalTemplate.AutoTextEntries.Add(strNewEntry, objWord.Selection.Range)
objWord.NormalTemplate.AutoTextEntries(strNewEntry).Value = strNewEntry
For Each i In objWord.NormalTemplate.AutoTextEntries
If i.Name = strOldEntry Then
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Your question, your audience. Choose who sees your identity—and your question—with question security.