A family of Microsoft word processing software products for creating web, email, and print documents.
if you type POASattJointlyOrSeverally and then press F3, is the autotext inserted?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I am having problems with inserting autotext into a document. I have about 5 separate autotext paragraphs. I have a macro that goes to a bookmark and at the bookmark inserts autotext - nothing is being inserted at all.
This is the code I am using.
Sub POASattJointlyOrSeverally()
'
' POASattJointlyOrSeverally Macro
'
'
Selection.HomeKey Unit:=wdStory
Selection.GoTo What:=wdGoToBookmark, Name:="SubAttorneysToAct"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.TypeText Text:="POASattJointlyOrSeverally"
Selection.Range.InsertAutoText
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdStory
End Sub
Thank you
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
if you type POASattJointlyOrSeverally and then press F3, is the autotext inserted?
Use the following macro to insert your autotext entry. The macro will need to know where the autotext entry is stored. The most likely place will be the document template so call it from there e.g.
AutoTextToBM "SubAttorneysToAct", ActiveDocument.AttachedTemplate, "POASattJointlyOrSeverally"
If the bookmark is missing from the document and/or the autotext entry is not in the named template then nothing will be inserted.
Sub AutoTextToBM(strbmName As String, oTemplate As Template, strAutotext As String)
'strBMName is the name of the bookmark to fill
'oTemplate is the template with the autotext - probably ActiveDocument.AttachedTemplate
'strAutotext is the name of the autotext entry
Dim oRng As Range
On Error GoTo lbl_Exit
With ActiveDocument
Set oRng = .Bookmarks(strbmName).Range
Set oRng = oTemplate.AutoTextEntries(strAutotext).Insert _
(Where:=oRng, RichText:=True)
.Bookmarks.Add Name:=strbmName, Range:=oRng
End With
lbl_Exit:
Exit Sub
End Sub