i have one lips routine that add the open the new email, add the subject with the same name of the drawing
I have another the open an email and add the dwg file to the email
I would like to know if anybody can tell me how to add both of them so I have,
1. dwg file add to email
2. pdf file add to email
and 3 subject of the email to be the same name as the drawing
here is my main autolisp
Code:
defun c:mp ()
(setq getemail "Jeremiah.Parsons@applusrtd.com");input email of helper
(setq filepath (strcat "" (getvar "dwgname") ""))
;;Conversion Table
(while (vl-string-position 32 filepath)
(setq filepath (vl-string-subst "%20" " " filepath))
);end while
(while (vl-string-position 60 filepath)
(setq filepath (vl-string-subst "%3C" "<" filepath))
);end while
(while (vl-string-position 62 filepath)
(setq filepath (vl-string-subst "%3E" ">" filepath))
);end while
(while (vl-string-position 92 filepath)
(setq filepath (vl-string-subst "%5C" "\\" filepath))
);end while
(command "_.start" (strcat "mailto:" getemail "?Subject=" filepath))
);end defun
and here is the autolisp that add the dwg.
Code:
(vl-load-com)
(defun c:Edata (/ OUTLOOK MAIL-ITEM RECIPIANTS LOG-FILE ATTACHMENTS)
(if
(setq outlook (vlax-get-or-create-object "Outlook.Application"))
(progn
(setq mail-item (vlax-invoke-method outlook 'CreateItem 0))
;(vlax-invoke-method mail-item 'Save)
(vlax-invoke-method mail-item 'Display)
(ADD-RECIPIANTS MAIL-ITEM)
(vlax-put-property mail-item 'Subject "SUBJECT HERE")
(ATTACH-LOG-FILE MAIL-ITEM)
)
(princ "\nUnable to start Outlook...")
)
)
(setq dn1 (vl-filename-base (getvar "dwgname")))
(setq pn1 (vl-Filename-Base (vl-Filename-Directory (getvar "Dwgprefix"))))
(SETQ fn1 (STRCAT dn1 ".pdf"))
(defun ATTACH-LOG-FILE (MAIL-ITEM / ATTACHMENTS LOG-FILE)
;(setq sourcePath (getvar "dwgprefix"))
; (if (setq LOG-FILE (vl-directory-files sourcePath "*.dwg" 1))
; (foreach file LOG-FILE
(if (setq LOG-FILE (findfile fn1))
(progn
(setq ATTACHMENTS (vlax-get-property mail-item 'Attachments))
(vlax-invoke-method attachments 'Add LOG-FILE 1 1)
)
)
)
(defun ADD-RECIPIANTS (MAIL-ITEM / RECIPIANTS)
(setq recipiants (vlax-get-property mail-item 'Recipients))
(vlax-invoke-method
recipiants
'Add
"YOUR EMAIL HERE"
)
;(vlax-invoke-method
; recipiants
; 'ADD
; "email@email.com"
;(vlax-invoke mail-item 'Send)
)
(princ)
thanks in advance