msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Follow a link in the body of an Outlook email message

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
JROBIN



Joined: 22 Feb 2008
Posts: 1

PostPosted: Fri Feb 22, 2008 12:32 am    Post subject: Follow a link in the body of an Outlook email message Reply with quote

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

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Fri Feb 22, 2008 1:51 pm    Post subject: Re: Follow a link in the body of an Outlook email message Reply with quote

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"JROBIN" wrote in message @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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group