Reply
 
Thread Tools Display Modes
  #1   Report Post  
scorfman scorfman is offline
Junior Member
 
Posts: 0
Default Insert Hyperlink at Bookmark

Hi,
Forgive my lack of VBA experience. I'm sure I'm just dealing with a syntax error.

I am making a wizard that on document create based on a template, will query the user to enter a bug number via a wizard form. On closing the form, I want to create a hyperlink by concatenating the url to our bug tracker with the bug number they entered. Then, insert that hyperlink at a bookmark of a content control.

The bookmark is "BugNum"
The text box on the entry form is "BugNumTextBox"

Here is my failing VBAcode:

Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("BugNum").Range _
.InsertBefore.Hyperlinks.Add Anchor:=Selection.Range, _
Address:="http://bugs.ourbugtracker.net/show_bug.cgi?id=" & BugNumTextBox
End With

UserForm1.Hide

End Sub
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add hyperlink/bookmark to each page --- PDF James Ivey New Users 6 March 2nd 09 07:59 AM
The Insert Bookmark box shouldnt vanish after adding a bookmark. RogerKni Microsoft Word Help 4 September 26th 06 03:13 PM
Hyperlink to previous/next bookmark Dan Perkins Microsoft Word Help 1 February 7th 06 02:08 PM
Hyperlink in word to a bookmark in a pdf Dawn Microsoft Word Help 0 June 13th 05 07:27 PM
Convert Word hyperlink with bookmark to PDf hyperlink elizabeyta Microsoft Word Help 3 March 30th 05 03:00 AM


All times are GMT +1. The time now is 12:32 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"