0 Members and 1 Guest are viewing this topic.
How about this, with "my" path to outlook.exe(startapp (strcat "c:\\program files\\Microsoft Office\\Office12\\outlook.exe " "/a " "P:\\Project Name\\Docs\\Document1.Doc"))
Quote from: paul_s on January 21, 2009, 12:08:52 PMHow about this, with "my" path to outlook.exe(startapp (strcat "c:\\program files\\Microsoft Office\\Office12\\outlook.exe " "/a " "P:\\Project Name\\Docs\\Document1.Doc"))I had already tried that...but still got switch errors.
(startapp "outlook.exe" (strcat "/a" " " "path_in_quotes"))
;;Usage(rjp-OutlookMessage ;;email address (multiple separated by semicolon) "johndoe@nowhere.com;johndoewife@nowhere.com" ;;Subject "Test Email" ;;Attachments as a list of strings '("C:\\test\\file1.txt" "C:\\test\\file2.txt" "C:\\test\\file3.txt") ;;Text in body of email "Nothing to read here :)" ;;nil will open email to edit...T will send email in the background nil)(defun rjp-OutlookMessage (To Subject AttachmentList Body Send / objMail objOL) (if (and (setq objOL (vlax-get-or-create-object "Outlook.Application")) (setq objMail (vlax-invoke-method objOL 'CreateItem 0)) ) (progn (vlax-put objMail 'To To) (vlax-put objMail 'Subject Subject) (vlax-put objMail 'Body Body) (foreach file AttachmentList (vl-catch-all-apply 'vlax-invoke (list (vlax-get objMail 'Attachments) 'Add file ) ) ) (if send (vlax-invoke objMail 'Send) (vlax-invoke objMail 'Display :vlax-true) ) (vlax-release-object objOL) (vlax-release-object objMail) ) ) (princ))
Ronjonp,WOW!..It worked!!!! So short & simple.Thank you!D-Unit,Thank you for your post. I will study this too.