Solved

Select shape after autotext insertion

Posted on 2009-07-02
5
325 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Software to count how many instances of words 109 201
recent docs in word and excel 3 53
VBA: Insert New column with specific format type 12 38
Need to merge 25 Word Docs into one 10 34
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

839 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