robierzo Posted September 6, 2012 Posted September 6, 2012 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. Quote
Lee Mac Posted September 6, 2012 Posted September 6, 2012 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) Quote
robierzo Posted September 6, 2012 Author Posted September 6, 2012 Thank you very much, Master. It is an honor! Quote
Lee Mac Posted September 6, 2012 Posted September 6, 2012 You're very welcome robierzo, happy to help. Quote
dober Posted September 7, 2012 Posted September 7, 2012 (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 September 7, 2012 by dober Quote
Lee Mac Posted September 7, 2012 Posted September 7, 2012 Super Lisp Thank you dober. I always have a fixed folder from where I'll get the linkCan 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)) Quote
Recommended Posts
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.