Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Cursor to End? 1

Status
Not open for further replies.

strebor

Technical User
Nov 24, 2004
66
US
I am working on a template. I have several autotext entries that will be placed in the template based on the choices a user makes in a user form. Putting 1 autotext entry in works fine... subsequent autotext entries merely overwrite the previous (or first) so that in the end the only autotext entry to make it is the last.

Here is what I've got...

Code:
Private Sub InsertTheComponents()

 Set rng = ActiveDocument.Sections(2).Range
    
    Selection.Collapse Direction:=wdCollapseEnd
    NormalTemplate.AutoTextEntries("Determine Asset Assignment").Insert Where:=rng, _
        RichText:=True
     NormalTemplate.AutoTextEntries("Verifying User").Insert Where:=rng, _
        RichText:=True
    Selection.Collapse Direction:=wdCollapseEnd
    NormalTemplate.AutoTextEntries("Verification IP Address").Insert Where:=rng, _
        RichText:=True
    Selection.Collapse Direction:=wdCollapseEnd
    NormalTemplate.AutoTextEntries("Assigned UserIDs").Insert Where:=rng, _
        RichText:=True
    Selection.Collapse Direction:=wdCollapseEnd
    NormalTemplate.AutoTextEntries("Computer Time Synchronization").Insert Where:=rng, _
        RichText:=True
    Selection.Collapse Direction:=wdCollapseEnd
    NormalTemplate.AutoTextEntries("Proxy Services").Insert Where:=rng, _
        RichText:=True

End Sub

Suggestions?

strebor
 
You may try to replace all:
Where:=rng
with:
Where:=Selection.Range

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Well... I know it is important to know the why... and I should take more time to learn more about this... and I should learn more about my car, and why my teenage son will not wake up in the morning and a whole bunch of other whys that I haven't got to, but... for right now... since I am just trying to cobble something together that works and this is not actually my real job... I guess I'm just happy that it works! But I do thank you and PHV and everyone that contributes to this forum. I promise to learn more about the word document model when I get a chance. I promise. Thank you!!

strebor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top