Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userform options to bookmarks

    How do you move values from Userform controls into Bookmarked fields on the New Document?
    I checked out Ken's online tutorial (which was excellent-BTW)[img]/w3timages/icons/thumbup.gif[/img]
    but it was written with Word2k and I only have W97, so I can't view the code or macros.

    Ideally, the User should be able to pick as many of the radio buttons as needed, and those values would populate the fields, in no particular order.
    Thanks for any help given

  2. #2
    New Lounger
    Join Date
    Jan 2001
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform options to bookmarks

    Could you explain a little more clearly what you are wanting to do? [img]/w3timages/icons/2cents.gif[/img]

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Userform text to bookmarks

    From a previous posting in the old lounge I think this code came from Gary and Geoff. It shows the syntax and you can hack this to come up with what you need.

    <pre>Dim ctlTemp As Control
    Dim strTag As String
    Dim strValue As String

    For Each ctlTemp In Me.Controls
    If TypeOf ctlTemp Is TextBox Then
    With ctlTemp
    strTag = .Tag
    strValue = Trim$(.Value)
    End With
    With ActiveDocument.Bookmarks
    If strValue <> vbNullString And .Exists(strTag) Then
    .Item(strTag).Range.Text = strValue
    End If
    End With
    End If
    Next ctlTemp</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    BAM
    Guest

    Re: Userform options to bookmarks

    You might want to take a look at this article from the MS Word MVP FAQ site. It may shed some light on what you are missing:
    <A target="_blank" HREF=http://mvps.org/word/FAQs/Userforms/CreateAUserForm.htm>http://mvps.org/word/FAQs/Userforms/CreateAUserForm.htm</A>

    Also, here is a link to the main Userforms FAQ articles:
    <A target="_blank" HREF=http://mvps.org/word/FAQs/Userforms/CreateAUserForm.htm>http://mvps.org/word/FAQs/Userforms/CreateAUserForm.htm</A>
    ~~~~~~~~~~
    Cheers!

Posting Permissions

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