Author Topic: Problem with 2 email lips, I need your help, Please - Solved thank you all  (Read 6201 times)

0 Members and 1 Guest are viewing this topic.

ChrisCarlson

  • Guest
Re: Problem with 2 email lips, I need your help, Please
« Reply #15 on: June 09, 2015, 01:23:10 PM »
Going off this thread, is it possible to load an existing email message?

I'm going to assume since it is not found here, it's not entirely possible.

https://msdn.microsoft.com/en-us/library/office/aa210946%28v=office.11%29.aspx

janthonylo

  • Guest
Re: Problem with 2 email lips, I need your help, Please
« Reply #16 on: June 09, 2015, 04:42:00 PM »
Thanks ChrisCalson,

janthonylo

  • Guest
Re: Problem with 2 email lips, I need your help, Please-Solved thanks :)
« Reply #17 on: June 12, 2015, 03:03:38 PM »
after few days working and getting help from all the nice people, thank all

here is, how finally ended,
1.attached pdf, dwg.
2. allowed my body to by my original signature
3. allowed to add recepient
4. 1 click and I have email with all this above.  great thank you all, :)

here is the final autolisp.


(defun c:mp ( / dir )
    (if (zerop (getvar 'dwgtitled))
        (princ "\nCurrent drawing is unsaved.")
        (rjp-outlookmessage
            "Jeremiah.Parsons@applusrtd.com"
            (getvar 'dwgname)
            (strcat 
                (setq dir (vl-string-right-trim "\\" (getvar 'dwgprefix)))
               
            )
            (vl-remove-if
               '(lambda ( x )
                    (wcmatch (vl-filename-extension x) ".log,.bak,.dwl2,.dwl")
                )
                (mapcar '(lambda ( x ) (strcat dir "\\" x)) (vl-directory-files dir nil 1))
            )
            nil
        )
    )
    (princ)
)

(defun rjp-outlookmessage ( rcp sub bdy att snd / atm msg out rtn )
    (if (setq out (vlax-get-or-create-object "outlook.application"))
        (progn
            (setq rtn
                (vl-catch-all-apply
                   '(lambda nil
                        (setq msg (vlax-invoke-method out 'createitem 0)
                              atm (vlax-get msg 'attachments)
                        )
                        (vlax-put msg 'to rcp)
                        (vlax-put msg 'subject sub)
                        (foreach fnm att
                            (if (setq fnm (findfile fnm))
                                (vlax-invoke atm 'add fnm)
                            )
                        )
                        (if snd
                            (vlax-invoke msg 'send)
                            (vlax-invoke msg 'display :vlax-true)
                        )
                        t
                    )
                )
            )
            (foreach obj (list atm msg out)
                (if (= 'vla-object (type obj))
                    (vlax-release-object obj)
                )
            )
            (if (vl-catch-all-error-p rtn)
                (prompt (vl-catch-all-error-message rtn))
                rtn
            )
        )
    )
)
 
(vl-load-com) (princ)




Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Why remove this?

Code - Auto/Visual Lisp: [Select]
  1. ;; Outlook Message  -  ronjonp (modified slightly by Lee Mac :-)
  2. ;; rcp - [str] Email address (separate multiple with semi-colon)
  3. ;; sub - [str] Subject
  4. ;; bdy - [str] Body of email
  5. ;; att - [lst] List of filenames to attach
  6. ;; snd - [bol] T=Send email; nil=Open email to edit

77077

  • Guest
@janthonylo
Please keep the notes and author name of  function

janthonylo

  • Guest
uups! very sorry, I was at the time very emotional that it worked, I did it only because I was concentrating on make it work and I did clean everything, after I posted here I did put all back. :) thank you very much Mr. lee
I have no way to appreciate your help, I do say thank you to you and all other who help me on this task.

janthonylo

  • Guest
as its today, and happyly working thank you again to all of you.


(defun c:mp ( / dir )
    (if (zerop (getvar 'dwgtitled))
        (princ "\nCurrent drawing is unsaved.")
        (rjp-outlookmessage
            "Jeremiah.Parsons@applusrtd.com"
            (getvar 'dwgname)
            (strcat 
                (setq dir (vl-string-right-trim "\\" (getvar 'dwgprefix)))
               
            )
            (vl-remove-if
               '(lambda ( x )
                    (wcmatch (vl-filename-extension x) ".log,.bak,.dwl2,.dwl")
                )
                (mapcar '(lambda ( x ) (strcat dir "\\" x)) (vl-directory-files dir nil 1))
            )
            nil
        )
    )
    (princ)
)

;; Outlook Message  -  ronjonp (modified slightly by Lee Mac :-)
;; rcp - [str] Email address (separate multiple with semi-colon)
;; sub - [str] Subject
;; bdy - [str] Body of email
;; att - [lst] List of filenames to attach
;; snd - [bol] T=Send email; nil=Open email to edit
.

(defun rjp-outlookmessage ( rcp sub bdy att snd / atm msg out rtn )
    (if (setq out (vlax-get-or-create-object "outlook.application"))
        (progn
            (setq rtn
                (vl-catch-all-apply
                   '(lambda nil
                        (setq msg (vlax-invoke-method out 'createitem 0)
                              atm (vlax-get msg 'attachments)
                        )
                        (vlax-put msg 'to rcp)
                        (vlax-put msg 'subject sub)
                        (foreach fnm att
                            (if (setq fnm (findfile fnm))
                                (vlax-invoke atm 'add fnm)
                            )
                        )
                        (if snd
                            (vlax-invoke msg 'send)
                            (vlax-invoke msg 'display :vlax-true)
                        )
                        t
                    )
                )
            )
            (foreach obj (list atm msg out)
                (if (= 'vla-object (type obj))
                    (vlax-release-object obj)
                )
            )
            (if (vl-catch-all-error-p rtn)
                (prompt (vl-catch-all-error-message rtn))
                rtn
            )
        )
    )
)
 
(vl-load-com) (princ)




bilançikur

  • Newt
  • Posts: 82
as its today, and happyly working thank you again to all of you.


(defun c:mp ( / dir )
    (if (zerop (getvar 'dwgtitled))
        (princ "\nCurrent drawing is unsaved.")
        (rjp-outlookmessage
            "Jeremiah.Parsons@applusrtd.com"
            (getvar 'dwgname)
            (strcat 
                (setq dir (vl-string-right-trim "\\" (getvar 'dwgprefix)))
               
            )
            (vl-remove-if
               '(lambda ( x )
                    (wcmatch (vl-filename-extension x) ".log,.bak,.dwl2,.dwl")
                )
                (mapcar '(lambda ( x ) (strcat dir "\\" x)) (vl-directory-files dir nil 1))
            )
            nil
        )
    )
    (princ)
)

;; Outlook Message  -  ronjonp (modified slightly by Lee Mac :-)
;; rcp - [str] Email address (separate multiple with semi-colon)
;; sub - [str] Subject
;; bdy - [str] Body of email
;; att - [lst] List of filenames to attach
;; snd - [bol] T=Send email; nil=Open email to edit
. ;<-- need to remove this

(defun rjp-outlookmessage ( rcp sub bdy att snd / atm msg out rtn )
    (if (setq out (vlax-get-or-create-object "outlook.application"))
        (progn
            (setq rtn
                (vl-catch-all-apply
                   '(lambda nil
                        (setq msg (vlax-invoke-method out 'createitem 0)
                              atm (vlax-get msg 'attachments)
                        )
                        (vlax-put msg 'to rcp)
                        (vlax-put msg 'subject sub)
                        (foreach fnm att
                            (if (setq fnm (findfile fnm))
                                (vlax-invoke atm 'add fnm)
                            )
                        )
                        (if snd
                            (vlax-invoke msg 'send)
                            (vlax-invoke msg 'display :vlax-true)
                        )
                        t
                    )
                )
            )
            (foreach obj (list atm msg out)
                (if (= 'vla-object (type obj))
                    (vlax-release-object obj)
                )
            )
            (if (vl-catch-all-error-p rtn)
                (prompt (vl-catch-all-error-message rtn))
                rtn
            )
        )
    )
)
 
(vl-load-com) (princ)

There is just a minor error inside... said untested