Re: scripting message with attachment
- From: ac2006 <ac2006@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Apr 2008 13:54:01 -0700
Hi Sue,
Thank you for your response. However, the link you provided takes me to two
redirect pages and at the final page it crashes out both I.E. and Firefox.
Do you happen to have another link with the same info?
--Ali
"Sue Mosher [MVP-Outlook]" wrote:
Outlook doesn't know anything about files. You either have to know the name or use FileSystemObject or other methods to determine the file name. See http://msdn.microsoft.com/library/en-us/script56/html/jsfsotutor.asp for an FSO reference..
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"ac2006" <ac2006@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:41482A1C-2C1C-4B93-8E90-95723ED9C0BE@xxxxxxxxxxxxxxxx
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 = "recipent@xxxxxxxxxx"
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
- Follow-Ups:
- Re: scripting message with attachment
- From: Sue Mosher [MVP-Outlook]
- Re: scripting message with attachment
- References:
- scripting message with attachment
- From: ac2006
- Re: scripting message with attachment
- From: Sue Mosher [MVP-Outlook]
- scripting message with attachment
- Prev by Date: Re: how to get the Appointment End property
- Next by Date: Re: scripting message with attachment
- Previous by thread: Re: scripting message with attachment
- Next by thread: Re: scripting message with attachment
- Index(es):
Relevant Pages
|
Loading