![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I'd like to script sending a message with an attachment. I've found how to do this when you know the attachment's name. But I need to script adding an attachment when I don't know it's name. The file I want to attach will always be located in C:\Reports and will always be a PDF, but the name will change every day. I tried ATT = "C:\Reports\*.pdf" but that didn't work. I copied this script from a site and modified it for my needs, I really don't know anything about scripting. Any help would be appreciated. Thank you. RCP = " MSG = "Test message" SUBJ = "Test subject" ATT = "C:\Reports\Attachment.pdf" Set Outlook = CreateObject("Outlook.Application") Set MAPI = Outlook.GetNameSpace("MAPI") Set NewMail = Outlook.CreateItem(0) NewMail.Subject = SUBJ NewMail.Body = MSG NewMail.Recipients.Add RCP NewMail.Attachments.Add ATT NewMail.Send |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Message As An Attachment | JoeCL | Outlook - Installation | 1 | August 23rd 06 05:05 PM |
e-mail attachment message | Julie Lindblad | Outlook Express | 6 | July 21st 06 05:44 PM |
Recieving a message with attachment and I can't view message body | mytwosweetpeas | Outlook - General Queries | 0 | July 7th 06 07:48 PM |
See attachment line in new message? | cjlatta | Outlook - Installation | 1 | June 15th 06 11:16 PM |
Adding attachment to message | David Wendt | Add-ins for Outlook | 5 | April 24th 06 02:28 PM |