A
Anne P.
Hi all,
I found this line regarding AutoText in the VBA help file:
Selection.CreateAutoTextEntry "handdel", "Mailing Instructions"
This line would create an AutoText entry called handdel in the Mailing
Instructions category from the selection in the current document. If I keep
changing the information in the quotes to what I want it to be, it works
fine.
I am trying to create a macro that would automate this for me, as I have a
lot of new entries I want to create in particular categories. Following is
my code:
Public Sub CreateNewAutoText()
Dim strATName As String
Dim strATCategory As String
'Get the AutoText Name
Dim Message, Title
Message = "Enter the name for the AutoText Entry" ' Set prompt.
Title = "Create AutoText Entry" ' Set title.
strATName = InputBox(Message, Title)
'Get the AutoText Category
Dim atMessage, atTitle
Message = "Enter the category for the AutoText Entry" ' Set prompt.
Title = "Create AutoText Entry" ' Set title.
strATCategory = InputBox(atMessage, atTitle)
Selection.CreateAutoTextEntry "strATName", "strATCategory"
End Sub
When I run the macro, instead of what I expect, I get a new category called
stATCategory, with a new entry named strATName.
Am I dreaming here that I can do this?
Thanks,
Anne
I found this line regarding AutoText in the VBA help file:
Selection.CreateAutoTextEntry "handdel", "Mailing Instructions"
This line would create an AutoText entry called handdel in the Mailing
Instructions category from the selection in the current document. If I keep
changing the information in the quotes to what I want it to be, it works
fine.
I am trying to create a macro that would automate this for me, as I have a
lot of new entries I want to create in particular categories. Following is
my code:
Public Sub CreateNewAutoText()
Dim strATName As String
Dim strATCategory As String
'Get the AutoText Name
Dim Message, Title
Message = "Enter the name for the AutoText Entry" ' Set prompt.
Title = "Create AutoText Entry" ' Set title.
strATName = InputBox(Message, Title)
'Get the AutoText Category
Dim atMessage, atTitle
Message = "Enter the category for the AutoText Entry" ' Set prompt.
Title = "Create AutoText Entry" ' Set title.
strATCategory = InputBox(atMessage, atTitle)
Selection.CreateAutoTextEntry "strATName", "strATCategory"
End Sub
When I run the macro, instead of what I expect, I get a new category called
stATCategory, with a new entry named strATName.
Am I dreaming here that I can do this?
Thanks,
Anne