Solved

Select shape after autotext insertion

Posted on 2009-07-02
5
324 Views
Last Modified: 2012-05-07
I have an autotext entry which inserts some text and then it inserts a coloured text box. The problem I have is that I can't work out how to select the text box that was just inserted through this autotext entry.  I can't use shape.name as there could be multiples of this shape inserted. Can someone shed some light on this matter for me?  
ActiveDocument.AttachedTemplate.AutoTextEntries("Expanding Text Box").Insert Where:=Selection.Range, RichText:=True

Open in new window

0
Comment
Question by:Fi69
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24785531
Can you explain why you're using a textbox?
0
 

Author Comment

by:Fi69
ID: 24793784
Hi there.  My template is a newsletter with coloured highlight boxes.  So they put a little bit of text in the coloured box that they want to draw the reader's attention to.
0
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 500 total points
ID: 24794563
If the text box is set to be "inline with text" you could use the following code....
    NormalTemplate.AutoTextEntries("TestingTextBox").Insert Where:=Selection. _
        Range, RichText:=True
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend

Open in new window

0
 

Author Closing Comment

by:Fi69
ID: 31599314
Didn't think of that!
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24914731
Great!  Thanks so much... glad I was able to help.

Joanne Orzech
MS Word MVP
EE Zone Advisor
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question