×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBA Hyperlinks to layouts..

VBA Hyperlinks to layouts..

VBA Hyperlinks to layouts..

(OP)
Hyperlinks in VBA, what gives?...

I can't code for these properly and dunno what could be wrong..

ok, story so far....

........i noticed that if you create a fresh hyperlink in AutoCAD and select Target, selecting a layout...this is what is displayed in the hyperlink editor:

Text to display: #,6551-060
Type the web page of file name: #,6551-060
Path: #,6551-060

(6551-060 is of course one of my layout names)



CODE

' Add the Hyperlink to the block to link back to the Layout..
Dim Hyp as AcadHyperlink
Dim HypS as AcadHyperlinks
Set HypS = blockX.Hyperlinks
 
' Add a new Hyperlink complete with all properties
Set Hyp = HypS.Add(LayoutLIST.Text)
Hyp.URL = "#," & LayoutLIST.Text
Hyp.URLDescription = "," & LayoutLIST.Text
Hyp.URLNamedLocation = "#," & LayoutLIST.Text

So thats cool, but if you run the code above, it displays (in the hyperlink editor) as:

Text to display: #,6551-060
Type the web page of file name: ##,6551-060
Path: ##,6551-060

Showing 2 # instead of 1 # infront of the layout name..


I have change some of the code around and managed to get it to read as the manual link text, which is what it is supposed to look loke i think but when you try the link (this also happens no matter what code i try) it loads up Windows Explorer to the path of the drawing and also if you try to edit the hyperlink, and press Target, AutoCAD says ''..

All the VBA examples i have found so far online, in books or in the help in ACAD, just show hyperlinks for web sites, not for named locations ie layouts, well not properly..

So how do i do this, must be so simple but can't see it..

Any ideas?

     Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 2GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close