Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Assigning Variable (Word VBA)

    I need to assign the contents of a bookmark to a variable so I can use the contents to name the document. I'm not sure how to use the bookmark object for this:

    Dim strFilename As String
    strFilename = [contents of the bookmark "Filename"]
    ActiveDocument.SaveAs (strFilename)

    TYIA,

    Jeanie

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

    Re: Assigning Variable (Word VBA)

    Use

    strFilename = ActiveDocument.Bookmarks("Filename").Range.Text

Posting Permissions

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