R
Roderick O'Regan
I've got a userform with a few buttons each holding a thumbnail
picture.
The user clicks on the appropriate button as if to say "I want this
big picture placed in the document".
Each big picture in question is an AutoText entry named oFig1, oFig2,
and so on.
Below is the code I use in each button at the cmdButton1_Click:
ActiveDocument.AttachedTemplate.AutoTextEntries("oFig1").Insert _
Where:=Selection.Range, RichText:=True
However, the client now wants some major alterations. They still want
to use the same thumbnail selection in a UserForm but I now need to
put the code mentioned above in a Module procedure which does a lot of
other things.
In the code above is the name of the AutoText entry so if the user
pressed cmdButton1 in the userform which asked for oFig1 how, please,
can I pass this string to the Module procedure now holding:
ActiveDocument.AttachedTemplate.AutoTextEntries("XXXXX").Insert _
Where:=Selection.Range, RichText:=True
....and putting it where the XXXX is at present?
Presumably, I'd need a variable (e.g. pString) in the Module
procedure to hold the incoming string which in turn would be passed to
the code as follows:
ActiveDocument.AttachedTemplate.AutoTextEntries("pString").Insert_
Where:=Selection.Range, RichText:=True
....or am I trying to overcomplicate things?
picture.
The user clicks on the appropriate button as if to say "I want this
big picture placed in the document".
Each big picture in question is an AutoText entry named oFig1, oFig2,
and so on.
Below is the code I use in each button at the cmdButton1_Click:
ActiveDocument.AttachedTemplate.AutoTextEntries("oFig1").Insert _
Where:=Selection.Range, RichText:=True
However, the client now wants some major alterations. They still want
to use the same thumbnail selection in a UserForm but I now need to
put the code mentioned above in a Module procedure which does a lot of
other things.
In the code above is the name of the AutoText entry so if the user
pressed cmdButton1 in the userform which asked for oFig1 how, please,
can I pass this string to the Module procedure now holding:
ActiveDocument.AttachedTemplate.AutoTextEntries("XXXXX").Insert _
Where:=Selection.Range, RichText:=True
....and putting it where the XXXX is at present?
Presumably, I'd need a variable (e.g. pString) in the Module
procedure to hold the incoming string which in turn would be passed to
the code as follows:
ActiveDocument.AttachedTemplate.AutoTextEntries("pString").Insert_
Where:=Selection.Range, RichText:=True
....or am I trying to overcomplicate things?