If I understand what you said and what you're asking then you can retrieve
the HTMLBody property of the email and parse the HTML to find your link and
then use your favorite method of retrieving the file pointed to in the link
and save it where you want.
"JROBIN" <JROBIN@discussions.microsoft.com> wrote in message
news:A3B83809-ACCD-4897-8BCA-9F032B205123@microsoft.com...
> Hi,
>
> I'm a neophyte when it comes to coding VBA in Outlook. I do all of my work
> primarily in Excel.
>
> Here's my issue: I run a file that executes SQL data in the background. I
> set the parameters in the GUI ie; date, location etc and the application
> sends me an email with a link on it when the SQL is complete. I open the
> message in Outlook and click the underlined link that says file and it
> gives
> me the option to open or save the dataset.
>
> What I would like to do is write VBA that will open the file and save it
> to
> the local hard drive. Now mind you - it is a link embedded in the email
> message and not an attachement. I've opened excel and used the macro
> recorder
> with limited success because I'm hardcoding the link into VBA. The problem
> is
> the link is different each time the SQL is run even though the parameters
> may
> not change and I can't pick up the link.
>
> I have a small VBS file that will tie to the scheduler in Windows and
> hopefully kick off the above VBA routine if I can get it to work.
>
> --
> JROBIN