+ Reply to Thread
Results 1 to 4 of 4

Add hyperlink to body of email thru Excel

  1. #1
    Registered User
    Join Date
    08-24-2004
    Posts
    14

    Exclamation Add hyperlink to body of email thru Excel

    Hi,

    I have a macro that saves an excel file and sends it to various recipients. How would I add a hyperlink to the body of the email instead of the actual file itself?


    ActiveWorkbook.SendMail Recipients:=Array("Body, Ann E"), _
    Subject:="Test Hyperlink"


    Thanks in advance.

  2. #2
    MacroAlan
    Guest

    RE: Add hyperlink to body of email thru Excel

    Try something like:

    With usrAPinvoices
    If usrAPinvoices.optEmailRpts = True Then
    Application.DisplayAlerts = False
    'mailing routine
    Workbooks(ExpFileName).Activate
    mMsg = "This Invoice file created on " & Application.Text(Now(),
    "dd mmm yyyy HH:mm") _
    & ". http://xl.barasch.com"
    If ActiveWorkbook.HasRoutingSlip = False Then
    ActiveWorkbook.HasRoutingSlip = True
    End If
    With ActiveWorkbook.RoutingSlip
    .Recipients = BranchAdmin
    .Subject = Branch & " AP Invoices"
    .Message = mMsg
    .Delivery = xlAllAtOnce
    .ReturnWhenDone = False
    .TrackStatus = True
    End With
    Application.DisplayAlerts = True
    Else
    'don't mail
    End If
    End With



    "MAYDAY" wrote:

    >
    > Hi,
    >
    > I have a macro that saves an excel file and sends it to various
    > recipients. How would I add a hyperlink to the body of the email
    > instead of the actual file itself?
    >
    >
    > ActiveWorkbook.SendMail Recipients:=Array("Body, Ann E"), _
    > Subject:="Test Hyperlink"
    >
    >
    > Thanks in advance.
    >
    >
    > --
    > MAYDAY
    > ------------------------------------------------------------------------
    > MAYDAY's Profile: http://www.excelforum.com/member.php...o&userid=13548
    > View this thread: http://www.excelforum.com/showthread...hreadid=385245
    >
    >


  3. #3
    Forum Contributor
    Join Date
    12-11-2004
    MS-Off Ver
    2007
    Posts
    137
    Hello

    I hope this help you


    Sub CreationMailEtLienHypertexte()
    Dim OlApp As New Outlook.Application
    Dim OlItem As Outlook.MailItem

    Set OlItem = OlApp.CreateItem(olMailItem)

    With OlItem
    .To = "[email protected]"
    .Subject = "Le titre du message"
    .HTMLBody = "<BODY><A href='" & ThisWorkbook.FullName & _
    "'>The WorkBook</A></BODY>" 'adapt the link
    .Display
    .Save
    .send
    End With

    Set OlItem = Nothing
    Set OlApp = Nothing
    End Sub



    Regards ,
    michel

  4. #4
    Ron de Bruin
    Guest

    Re: Add hyperlink to body of email thru Excel

    Hi

    Try this if you use Outlook (see macro example on this page)
    http://www.rondebruin.nl/sendmail.htm

    Use

    ..Body = "file://Yourcomputer/YourFolder/Week2.xls"
    If there are spaces use %20
    ..Body = "file://Yourcomputer/YourFolder/Week%202.xls"

    Example for a file on a website
    ..Body = "http://www.rondebruin.nl/files/EasyFilter.zip"


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "MAYDAY" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi,
    >
    > I have a macro that saves an excel file and sends it to various
    > recipients. How would I add a hyperlink to the body of the email
    > instead of the actual file itself?
    >
    >
    > ActiveWorkbook.SendMail Recipients:=Array("Body, Ann E"), _
    > Subject:="Test Hyperlink"
    >
    >
    > Thanks in advance.
    >
    >
    > --
    > MAYDAY
    > ------------------------------------------------------------------------
    > MAYDAY's Profile: http://www.excelforum.com/member.php...o&userid=13548
    > View this thread: http://www.excelforum.com/showthread...hreadid=385245
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1