[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Link Button or Hyperlink in Word Document to User Form

Posted on 2011-05-01
15
Medium Priority
?
717 Views
Last Modified: 2012-05-11
Hello,

I am creating a user form in Word for users to fill in. How is it possible to create either a Hyperlink or Button in the Word Document so that when someone clicks on it it will call the User Form?

I am using Word 2007 and 2010 for this User Form (not sure if the solution will differ between versions?)

Thanks in advance.

GISVPN
0
Comment
Question by:gisvpn
  • 5
  • 4
  • 4
  • +1
15 Comments
 
LVL 10

Expert Comment

by:honestman31
ID: 35500152
0
 

Author Comment

by:gisvpn
ID: 35500160
Hi honestman31: thanks for the post, I am not sure if you have fully read the question but im trying to use a hyperlink and or button to call a User Form?

The link you posted I think just explains links in Word?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35500166
You can use  Macrobutton field  to call a macro like this:

Sub OpenForm()
    UserForm1.Show
End Sub  
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:honestman31
ID: 35500167
is the form inside the same document ? if so then the link is correct
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35500583
- try the instruction in the following page. in the macro modules, put the syntax "formname.show" (without the doublequotes) to display the form.

http://word.mvps.org/FAQs/MacrosVBA/AssignMacroToButton.htm 
0
 

Author Comment

by:gisvpn
ID: 35503935
Hi there thansk for the posts.

GrahamSkan - thanks for this I think this will be part of the solution as put forward by OP_Zaharin.

OP_Zaharin - This article works really well, however there is a problem. Everytime you close and reopen the document you have to select 'Toggle Field Codes' again for it to become a clickable hypertext.. so does not really work that well - is there another way?

 
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35503968
- you can either use Alt + F9 shortcut OR
- from the Office button - click Word Options - select Advanced and in the Show document content section, uncheck the checkbox for "Show field codes instead of their values".
0
 

Author Comment

by:gisvpn
ID: 35504179
Humm I dont think that will work; I simply want to allow the user to click the link or button to open the form.

Is there anyway to do this via hyperink?

GISVPN
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35504257
- none as i know. the only way is to set the following at all the users msword option (only one time), then it will appear as a link :
"from the Office button - click Word Options - select Advanced and in the Show document content section, uncheck the checkbox for "Show field codes instead of their values"
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35504492
This should work. What is the problem?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35504519
You could also insert the field the Quick parts button on the Insert tab.
Choose Field..., select Macrobutton and put the macro name in. That way you won't have to switch to the Field codes view, if that is what you are having difficulty with.
0
 

Author Comment

by:gisvpn
ID: 35504836
Hi GrahamSkan, looking at your suggestion and OP_Zaharin's one they both result in exactly the same thing. When the document is saved and the reopened you just see this on the screen :

{ MACROBUTTON MyMacroName Double-Click To Run Macro }

you then have to right click it and select 'Toggle Field Codes'  to see it as a clickable link; which is not very good.

I have used this in Excel to do what I am trying to do in Word; Can I do something similar like this but in Word??

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

If Target.Name = "Run Extractor 1" Then
Call converter1
End If


End Sub

Open in new window

0
 

Author Comment

by:gisvpn
ID: 35697278
Can anyone comment on the above :) ?

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35697295
- have you set the below? this setting should show the link not the { MACROBUTTON MyMacroName Double-Click To Run Macro }

from the Office button - click Word Options - select Advanced and in the Show document content section, uncheck the checkbox for "Show field codes instead of their values".
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 35697793
To emphasise. There are two views for fields - the code and the results. The Alt+F9 key stroke shortcut toggles between them for the whole document.

The Word document has a FollowHyperlink method which will do the same as clicking on the Hyperlink does. It does not have a FollowHyperlink event which could be used to do something else when the Hyperlink is clicked. We must use a Macrobutton field to call VBA code instead.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question