G
Greg
I just noticed a problem inserting AutoText with VBA. Several weeks
ago I created several AutoText entries under a Style named "Toggles."
This resulted in a category in my AutoText list where I can select from
a variety of similiar entries. Today I recorded the following macro:
Sub InsertAutoText()
' Macro recorded 12/08/2005 by CDR G. K. Maxey
Application.DisplayAutoCompleteTips = True
NormalTemplate.AutoTextEntries("Checked Box").Insert Where:=Selection.
_
Range
End Sub
The action of recording the macro did in fact insert the AutoText entry
I have for a checked box.
I then attempted to run the macro and recieved a runtime error 5941
"The member of the collection does not exist."
Next I tried changing ("Checked Box") to (8). The "Checked Box" entry
is the 8th member of my AutoText enties in the list
Insert>AutoText>AutoText. The result after running this revised macro
is that "Confidential" is inserted in at the selection. Confidential
is the 10th entry in my AutoText list. :-(
Next I selected my checked box and created a new AutoText entry named
"Checked Box1" and changed the code in the above macro to "Checked
Box1." It performed as expected and inserted the checked box at the
selection.
I the problem is related to the fact that "Checked Box" is an AutoText
entry that I created in a style named "Toggles." How do you
programatically insert an AutoText entry created in this manner?
Thanks.
ago I created several AutoText entries under a Style named "Toggles."
This resulted in a category in my AutoText list where I can select from
a variety of similiar entries. Today I recorded the following macro:
Sub InsertAutoText()
' Macro recorded 12/08/2005 by CDR G. K. Maxey
Application.DisplayAutoCompleteTips = True
NormalTemplate.AutoTextEntries("Checked Box").Insert Where:=Selection.
_
Range
End Sub
The action of recording the macro did in fact insert the AutoText entry
I have for a checked box.
I then attempted to run the macro and recieved a runtime error 5941
"The member of the collection does not exist."
Next I tried changing ("Checked Box") to (8). The "Checked Box" entry
is the 8th member of my AutoText enties in the list
Insert>AutoText>AutoText. The result after running this revised macro
is that "Confidential" is inserted in at the selection. Confidential
is the 10th entry in my AutoText list. :-(
Next I selected my checked box and created a new AutoText entry named
"Checked Box1" and changed the code in the above macro to "Checked
Box1." It performed as expected and inserted the checked box at the
selection.
I the problem is related to the fact that "Checked Box" is an AutoText
entry that I created in a style named "Toggles." How do you
programatically insert an AutoText entry created in this manner?
Thanks.