Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Hyperlink macrobutton in a protected form document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elizabeth - 01 Mar 2005 14:39 GMT
I followed the MVP site instructions for getting a
hyperlink to work in a document protected for forms, but
get an error message that says "DisplayText cannot span
more than one line!"

{Macrobutton FollowLink "Text to
display"{HYPERLINK "M:\Controls\Usage Records
records\Calibrated Equipment.xls"}

Does anyone know what I'm doing wrong?
Jay Freedman - 01 Mar 2005 19:53 GMT
> I followed the MVP site instructions for getting a
> hyperlink to work in a document protected for forms, but
[quoted text clipped - 6 lines]
>
> Does anyone know what I'm doing wrong?

First, remove the part of the field code that says "Text to display" --
that's unnecessary, and it's making the display text too long. Then update
the field (press F9) and the field should display the hyperlink.

It's true that a macrobutton field can't display text on more than one line,
and this could cause a problem if the path to the file or web page is longer
than Word's line length. If it's only a little too long, you can fiddle with
the paragraph indents to give it more room, or you can reduce the font size.

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

Elizabeth - 02 Mar 2005 11:01 GMT
Thank you, Jay. I had our MIS department shorten the
folder name on our network. However, I do not want the
path name to display in the form - I just want the user to
see something like "Equipment List". The MacroButton
command on its own allows you to specify the text to
display, but I can't work out how to get the setting right
with the MacroButton and Hyperlink combined. Any
suggestions?

Cheers,
Elizabeth

>-----Original Message-----
>> I followed the MVP site instructions for getting a
[quoted text clipped - 16 lines]
>than Word's line length. If it's only a little too long, you can fiddle with
>the paragraph indents to give it more room, or you can reduce the font size.
Jay Freedman - 02 Mar 2005 15:36 GMT
Hi Elizabeth,

Yes, you can do this, indirectly.

Although a hyperlink is represented in a document as a field, it's actually
a more complex object. It has separate storage for the displayed text and
the destination address. When you create a hyperlink field by typing its
code, you're directly setting the destination address and Word makes the
display text equal to that string. When you use the Insert > Hyperlink
dialog, though, you can enter different display text. That's what will show
when you nest the hyperlink inside a macro button field.

For existing macrobuttons, edit them as follows, after temporarily turning
off protection: Click once on the macrobutton and press Shift+F9 to open the
field code. Right-click the hyperlink and select Edit Hyperlink. Change the
"Text to display" box to the short form. Click OK, then press F9 to update
the field. If you look again at the field code, the hyperlink field still
shows the full path, but collapsing it will show the display text.

For new links, insert the hyperlink first with the dialog, and set the
display text there. Then type the "Macrobutton FollowLink" keywords to its
left, select it all, and press Ctrl+F9 and then F9.

With this change, it no longer matters how long the actual path is (but I
think it may be truncated in the hyperlink if you exceed 255 characters).

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

> Thank you, Jay. I had our MIS department shorten the
> folder name on our network. However, I do not want the
[quoted text clipped - 37 lines]
>>
>> .
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.