How can i insert the full autotext entry and not just the text?

How can i insert the full autotext entry and not just the text?

Post by UGV0ZX » Wed, 14 Jan 2009 12:04:00


reg and Doug (and others)

Thanks to your help so far. I can now scroll through the combolist (or type
the first couple of characters) to find the name of the autotext entry and
then click the the INSERT AS TEXT" button to insert it into the doucment or
another button to insert it as a comment. This is Good.

BUT if the autext entry contains an image the inserted item contains
something like "* EMBED Equation.DSMT4 **" and not the image. If I insert it
using INSERT > AUTOTEXT then the original with the image is inserted.

I have been using
ActiveDocument.Comments.Add Range:=Selection.Range,
_Text:=txtAutotextValue.Text

or even the following to try to get the complete value of autotext item 87

Selection.InsertAfter NormalTemplate.AutoTextEntries(87)

But all I get entered is the text of the item and not the complete item.
How can I insert the real item?

The reason that I am using my own button to insert the item is that I also
want to add other items to the comment or the text.


"Greg Maxey" wrote:

 
 
 

How can i insert the full autotext entry and not just the text?

Post by Greg Maxe » Thu, 15 Jan 2009 23:14:12

eter,

You insert an autotext entry like this:

NormalTemplate.AutoTextEntries(87).Insert Selection.Range, True

You CAN'T insert a drawing object in a comment. The following example
illustrates:

Sub Test()
Dim oRng As Word.Range
Dim oCom As Comment
Set oCom = ActiveDocument.Comments.Add(Range:=Selection.Range, Text:="")
NormalTemplate.AutoTextEntries("87").Insert oCom.Range, True
End Sub


Peter wrote:

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org