Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Hyperlinks to layouts..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
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..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top