Jump to content

Recommended Posts

Posted

Hello. I have two questions.

1 - I need to read an hyperlink associated with a text. The HYPERLINK is an Excel file. I use this:

(setq nombre_ent (car(entsel "\nSelecciona objeto: ")))
 (setq obj_vla (vlax-ename->vla-object nombre_ent))
 (setq prop (vla-get-hyperlinks obj_vla))

 

 

How do I get the file name?

 

2 - How do I create an hyperlink to an Excel file associated with a text?

The file name is: "C: \ Temp \ Ventas_2012.xls"

Thank you.

Posted

Here are some examples:

 

Accessing Hyperlinks:

(defun c:test1 ( / en )
   (if (setq en (car (entsel "\nSelect Object to View Hyperlinks: ")))
       (vlax-for hyp (vla-get-hyperlinks (vlax-ename->vla-object en))
           (print (vla-get-url hyp))
       )
   )
   (princ)
)
(vl-load-com) (princ)

Adding Hyperlinks:

(defun c:test2 ( / en fn )
   (if
       (and
           (setq fn (getfiled "Select a File to Link to" "" "" 16))
           (setq en (car (entsel "\nSelect Object to Add Hyperlink: ")))
       )
       (vla-add (vla-get-hyperlinks (vlax-ename->vla-object en)) fn (vl-filename-base fn))
   )
   (princ)
)
(vl-load-com) (princ)

Posted (edited)

Thanks Has done

 

Hi Lee

 

Super Lisp

 

I always have a fixed folder from where I'll get the link

Can you set it too.

Thank you

 

Hallo Lee

 

Super Lisp

 

Ich habe immer einen fixen Ordner von wo ich den Hyperlink hole

Kann man das auch einstellen.

Danke

Edited by dober
Posted
Super Lisp

 

Thank you dober.

 

I always have a fixed folder from where I'll get the link

Can you set it too.

 

Change:

(setq fn (getfiled "Select a File to Link to" "" "" 16))

To:

(setq fn (getfiled "Select a File to Link to" "[color=red]C:\\YourFolder\\[/color]" "" 16))

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...