Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Inserting Hyperlink into Word 2010 Form control

    I am creating a Word 2010 form. I'd like it protected so that the standard text cannot be edited. Some areas of the form need to be customized per user, and for those, I'm using form controls.

    I want the user to be able to press CTRL+K to display the Insert Hyperlink box and be able to insert a hyperlink. So far, any of the text controls I've tried won't let me do that.

    Any suggestions on how I can successfully have a protected form that also allows a user to add a hyperlink?

    Thanks.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Are you using content controls, ActiveX controls, or formfields?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I am using content controls. But this is a new project for me, so if I need to use another feature of Word to make this work, I will.

    Thanks.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts
    There are two pieces to getting this to work:
    • The content control where you want the user to insert a hyperlink must be a Rich Text control. None of the other types will allow it.
    • To apply protection, do not use the "Filling in forms" option. Instead, use "No changes (Read only)"; then click in each content control in the form and check the Everyone box under Exceptions. When all of the content controls have been marked, click the Start Enforcing button.

  5. The Following 2 Users Say Thank You to jjfreedman For This Useful Post:

    bgarity (2013-11-05),Charles Kenyon (2013-11-04)

  6. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    To add to what Jay says, you'd ordinarily need to type a space or a tab after the address to get Word to convert it to a working hyperlink. If you'd rather not do that and the hyperlink is the control's only content, you could use a 'ContentControlOnExit' macro like the following in the document's 'ThisDocument' module.
    Code:
    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    With ContentControl
      If .Title = "HLink" Then
        .Range.Hyperlinks.Add Anchor:=.Range, Address:=.Range.Text
      End If
    End With
    End Sub
    As coded, the macro assumes the Content Control's title is 'HLink'.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. The Following User Says Thank You to macropod For This Useful Post:

    Charles Kenyon (2013-11-04)

  8. #6
    New Lounger
    Join Date
    Nov 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi Paul,
    I was able to use jjfreedman's instructions successfully without adding the macro that you suggest. However, all of this is very helpful. I appreciate the quick responses as I'm on a tight deadline. (Aren't they all?!)
    Brenda

Tags for this Thread

Posting Permissions

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