Manuel_Kunde Posted September 8, 2021 Posted September 8, 2021 Hi all, this is a snippet of a lisp that generates an email. How can I insert the DWGPREFIX as a link in the "Body"? It only comes out as pure text. (vlax-put-property objMail 'Body (getvar "DWGPREFIX")) Quote
Manuel_Kunde Posted September 8, 2021 Author Posted September 8, 2021 (edited) Ok I got it, you need to add "file:///" to the path. (vlax-put-property objMail 'Body (stract "file:///" (getvar "DWGPREFIX"))) Edited September 8, 2021 by Manuel_Kunde forget bracket Quote
tombu Posted September 8, 2021 Posted September 8, 2021 (edited) (vlax-put-property objMail 'Body (strcat "file:///" (getvar "DWGPREFIX"))) returns: ; error: bad argument type: VLA-OBJECT nil What's the rest of that lisp look like? Few related links: http://www.theswamp.org/index.php?topic=26953.msg324794#msg324794 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-e-mail-content-to-helpdesk/td-p/9077327 https://www.theswamp.org/index.php?topic=55486.0 Edited September 8, 2021 by tombu Added links Quote
Manuel_Kunde Posted September 8, 2021 Author Posted September 8, 2021 1 hour ago, tombu said: What's the rest of that lisp look like? Load and try. (defun c:outlook () (vl-load-com) (setq subject "This e-mail has no sense.") (setq to "email@example.com") (setq cc "emailtwo@example.com") ;carbon copy (setq name (getvar "loginname")) ;your loginname on the server (setq path (strcat (getvar "DWGPREFIX") (getvar "DWGNAME"))) ;path to your folder (setq body (strcat "You won't find anything in this folder." "\n" "\n" ;first line with text "file:///" Path "\n" "\n" ;second line with hyperlink "kind regards," "\n" Name)) ;last two ones with your signature (setq olApp (vlax-get-or-create-object "Outlook.Application")) ;Vendor.Component.Version (setq objMail (vlax-invoke olApp 'CreateItem 0)) (vlax-put-property objMail 'Subject subject) (vlax-put-property objMail 'To to) (vlax-put-property objMail 'cc cc) (vlax-put-property objMail 'Body body) ;----- request (setq request (acet-ui-message (strcat "Send e-mail " "to " to "?") "Request before sending" 1)) (if (= request 1) ;ok ;then (progn (vlax-invoke objMail 'Send)) ;finally sended ;else: (vl-exit-with-error (alert "Sending failed.")) ; end lisp ) ;----- ) 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.