Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Location
    San Leandro, California, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inserting input from userinput box (Word 97)

    I'm stuck! Can anyone help me with this project? I would like to create a template that requests user input -- case name & case number. This info would be inserted in several different locations in the document.

    I have the VBA code for the userbox ready -- my problem is in the template - getting the data inserted more than once.

    Any suggestions will be greatly appreciated!

  2. #2
    BAM
    Guest

    Re: Inserting input from userinput box (Word 97)

    Hi kvaldivi,

    If you are using a VBA Userform and already have Bookmarks in your template then insert additional Bookmarks for the duplicate information and in your code add a line that inserts the contents of your TextBox to another bookmark range.
    ~~~~~~~~~~~~
    Cheers!

  3. #3
    New Lounger
    Join Date
    Jun 2002
    Location
    San Leandro, California, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting input from userinput box (Word 97)

    BAM -- thanks for your help. I'm still having problems inserting info in multiple places. It seems that I can't Insert additional bookmarks with the same name. I've tried the REF field and that's not working either.

    <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

  4. #4
    BAM
    Guest

    Re: Inserting input from userinput box (Word 97)

    Hi kvaldivi,
    A Bookmark can only appear once in a document. You need additional Bookmarks but with different names.

    That way you can insert the contents of your TextBox on the Userform in two different locations.

    Your code would be something like:

    <pre>With ActiveDocument
    .Bookmarks("CaseName1").Range _
    .InsertBefore TextBox1
    .Bookmarks("CaseName2").Range _
    .InsertBefore TextBox1
    End With</pre>


  5. #5
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Oregon, USA
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting input from userinput box (Word 97)

    Just outta curiosity, did you make sure to update the REF fields after editing the bookmark? Add the following to the end of your procedure and you should get them to work.

    Activedocument.Fields.Update

    Chris

Posting Permissions

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