how to create a link for recipients to click on 
Author Message
 how to create a link for recipients to click on
Hi,

I want to create email (in VBA) with a link to my file so recipients can
double-click to open the file. How can I do that? I tried HTMLBody, but it
didn't make it a link, just plain text. Here's my code:

    Dim olApp As Outlook.Application, olMail As Outlook.MailItem

    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(olMailItem)

    olMail.To = "Recipient Names"
    olMail.Subject = "File"
    olMail.HTMLBody = "\\Server1\Folder1\File1"
    olMail.Send

    Set olApp = Nothing

Thanks,

Dan



Sat, 25 Dec 2004 23:50:23 GMT  
 how to create a link for recipients to click on
Hi Dan

Try something like:

olMail.HTMLBody = "Click <a href='\\Server1\Folder1\File1'>here</a> to open
the file."

in the place of your HTMLBody assignment.

The HTMLBody follows standard HTML rules.  Hope this helps!
--
Robert Dunn
Software Developer
Certiport, Inc.
801-492-1551x3017

Quote:

> Hi,

> I want to create email (in VBA) with a link to my file so recipients can
> double-click to open the file. How can I do that? I tried HTMLBody, but it
> didn't make it a link, just plain text. Here's my code:

>     Dim olApp As Outlook.Application, olMail As Outlook.MailItem

>     Set olApp = CreateObject("Outlook.Application")
>     Set olMail = olApp.CreateItem(olMailItem)

>     olMail.To = "Recipient Names"
>     olMail.Subject = "File"
>     olMail.HTMLBody = "\\Server1\Folder1\File1"
>     olMail.Send

>     Set olApp = Nothing

> Thanks,

> Dan



Sun, 26 Dec 2004 00:24:13 GMT  
 how to create a link for recipients to click on
Hi!

You need to use the attachments collection.

olMail.Attachments.Add "Path to file", 1, 1, "description"

Replace Path to file with the path to the file as a string
e.g. "C:\mydoc.doc" and description with a description of
the file that will be dislayed in the email.

You can delete this line:
olMail.HTMLBody = "\\Server1\Folder1\File1"

Dave

Quote:
>-----Original Message-----
>Hi,

>I want to create email (in VBA) with a link to my file so
recipients can
>double-click to open the file. How can I do that? I tried
HTMLBody, but it
>didn't make it a link, just plain text. Here's my code:

>    Dim olApp As Outlook.Application, olMail As
Outlook.MailItem

>    Set olApp = CreateObject("Outlook.Application")
>    Set olMail = olApp.CreateItem(olMailItem)

>    olMail.To = "Recipient Names"
>    olMail.Subject = "File"
>    olMail.HTMLBody = "\\Server1\Folder1\File1"
>    olMail.Send

>    Set olApp = Nothing

>Thanks,

>Dan

>.



Sun, 26 Dec 2004 00:29:54 GMT  
 how to create a link for recipients to click on
Thanks a lot, Robert. I'll try that.


Quote:
> Hi Dan

> Try something like:

> olMail.HTMLBody = "Click <a href='\\Server1\Folder1\File1'>here</a> to
open
> the file."

> in the place of your HTMLBody assignment.

> The HTMLBody follows standard HTML rules.  Hope this helps!
> --
> Robert Dunn
> Software Developer
> Certiport, Inc.
> 801-492-1551x3017




- Show quoted text -

Quote:
> > Hi,

> > I want to create email (in VBA) with a link to my file so recipients can
> > double-click to open the file. How can I do that? I tried HTMLBody, but
it
> > didn't make it a link, just plain text. Here's my code:

> >     Dim olApp As Outlook.Application, olMail As Outlook.MailItem

> >     Set olApp = CreateObject("Outlook.Application")
> >     Set olMail = olApp.CreateItem(olMailItem)

> >     olMail.To = "Recipient Names"
> >     olMail.Subject = "File"
> >     olMail.HTMLBody = "\\Server1\Folder1\File1"
> >     olMail.Send

> >     Set olApp = Nothing

> > Thanks,

> > Dan



Sun, 26 Dec 2004 01:08:13 GMT  
 how to create a link for recipients to click on
Dave, thanks for the help. -Dan


Quote:
> Hi!

> You need to use the attachments collection.

> olMail.Attachments.Add "Path to file", 1, 1, "description"

> Replace Path to file with the path to the file as a string
> e.g. "C:\mydoc.doc" and description with a description of
> the file that will be dislayed in the email.

> You can delete this line:
> olMail.HTMLBody = "\\Server1\Folder1\File1"

> Dave

> >-----Original Message-----
> >Hi,

> >I want to create email (in VBA) with a link to my file so
> recipients can
> >double-click to open the file. How can I do that? I tried
> HTMLBody, but it
> >didn't make it a link, just plain text. Here's my code:

> >    Dim olApp As Outlook.Application, olMail As
> Outlook.MailItem

> >    Set olApp = CreateObject("Outlook.Application")
> >    Set olMail = olApp.CreateItem(olMailItem)

> >    olMail.To = "Recipient Names"
> >    olMail.Subject = "File"
> >    olMail.HTMLBody = "\\Server1\Folder1\File1"
> >    olMail.Send

> >    Set olApp = Nothing

> >Thanks,

> >Dan

> >.



Sun, 26 Dec 2004 01:08:35 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. creating new starting homepage by clicking on a link

2. Linking Recipients to Contact Item???

3. Linking Recipients to Contacts

4. Link recipient to contacts?

5. Create Recipients Object in CDO

6. Creating a Task Without Recipients

7. Creating Recipients

8. creating a custom recipient in Exchange 5.5

9. Creating a custom recipient

10. delete/create a custom-recipient

11. Run VB code, when Link is clicked in HTML document

12. Topic Not Found, after clicking a link inside the help file

 

 
Powered by phpBB® Forum Software