Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select last added textbox (All)

    Hi

    I have defined a text box with default content, formatting, side etc under Autotext entries in my template. The user then inserts the text box (through Autotext entry selection) for the current paragraph. The text box is added to the left most side of the current paragraph.

    What I would like to be able to do is that when the user 'adds/inserts' the textbox from Autotext entry, it selects the textbox and sets cursor within the textbox (after the default content) for the user to make additions (which they would all the time). Is the at all possible? I should say it would then have to be done as macro (I assume).
    Thanks.
    Robie

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select last added textbox (All)

    Try something like this:

    Sub InsertTextBox()
    Dim rng As Range
    ActiveDocument.AttachedTemplate.AutoTextEntries("M yTextBox").Insert Where:=Selection.Range, RichText:=True
    Set rng = ActiveDocument.Shapes(ActiveDocument.Shapes.Count) .TextFrame.TextRange
    rng.Collapse wdCollapseEnd
    rng.Select
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select last added textbox (All)

    Perfect. Thanks works wonderfully well. The test users are really impressed.
    Thanks.
    Robie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •