Forum Discussion

Logaraj Sekar's avatar
Logaraj Sekar
Steel Contributor
Oct 31, 2021
Solved

Is that possible to add attachment in hyperlink formula?

 

 

=HYPERLINK("mailto:"&G2&"?subject=Test Mail"&"&body=This is Test Mail","Send Emails")

 

 

 

I want add attachment. Is that possible?

  • HansVogelaar's avatar
    HansVogelaar
    Oct 31, 2021

    Logaraj Sekar 

    You can send any open workbook as attachment using the SendMail method of the Workbook object, for example:

    Sub SendActiveWorkbook()
        ActiveWorkbook.SendMail Recipients:="emailaddress", Subject:="Monthly Report"
    End Sub

    If you want to add other files, you can use Automation to send a message using Outlook. For example:

    Sub SendWithAttachment()
        Dim objOL As Object
        Dim objMail As Object
        Set objOL = CreateObject("Outlook.Application")
        objOL.Session.Logon
        Set objMail = objOL.CreateItem(0)
        With objMail
            .To = "Someone"
            .CC = "Another"
            .Subject = "Monthly Report"
            .Body = "Please see the attached report"
            .Attachments.Add "PathAndFilename"
            ' Use only ONE of the following two lines
            .Display ' to inspect the message bedore sending it
            .Send ' to send the message immediately
        End With
    End Sub
  • WilburPierce's avatar
    WilburPierce
    Copper Contributor
    In German Manufacturing, the technical word used to indicate an action(s} take accumulated blinks or blinks of the eye. From these movements, costs of manufacturing in time and money are determined.

    All of us waste thurblicks on a variety of unnecessary actions such as “delete”, “Spam”, “Junk” &, “block sender”.

    I receive 200 to 500 annoying emails a day, many of them day after day from the same advertiser.

    I explained to the BIG M how to provide a quick delete email and preserve email in micro seconds.

    They failed at every attempt.

    Here is the logic if anyone can do it.

    Outlook is organized in domains,

    When one invokes it, all incoming fall into a date specific domain.

    Generally, email of importance hover around 10%

    The Date is defined a “Today”

    Under the Wilbur Macro”

    Of one day or a myriad of days, click only on those wanted saved,



    Assume that we click only one item. This indicates “SAVE” on each item selected.

    Any that are not selected go to “Potters Field” These are future blockers of incoming unwanted mail and stored. They may also be bloked in bulk.

    Now only the save appear,

    After Reading the Saves, any can be sent to Potters Field individually

    After the Saves are done, they are sent to the “Afterlife”, If they ever come in again, they are automatically saved so they come up behind the last one already saved,

    List cuts eliminates all junk everyday, saves conversations







    • Logaraj Sekar's avatar
      Logaraj Sekar
      Steel Contributor

      HansVogelaar ,

       

      Is there any other way to add attachment? (Or) Suggest me any other way to send email with attach.

       

      Using Excel 2016. VBA is Preferred.

       

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Logaraj Sekar 

        You can send any open workbook as attachment using the SendMail method of the Workbook object, for example:

        Sub SendActiveWorkbook()
            ActiveWorkbook.SendMail Recipients:="emailaddress", Subject:="Monthly Report"
        End Sub

        If you want to add other files, you can use Automation to send a message using Outlook. For example:

        Sub SendWithAttachment()
            Dim objOL As Object
            Dim objMail As Object
            Set objOL = CreateObject("Outlook.Application")
            objOL.Session.Logon
            Set objMail = objOL.CreateItem(0)
            With objMail
                .To = "Someone"
                .CC = "Another"
                .Subject = "Monthly Report"
                .Body = "Please see the attached report"
                .Attachments.Add "PathAndFilename"
                ' Use only ONE of the following two lines
                .Display ' to inspect the message bedore sending it
                .Send ' to send the message immediately
            End With
        End Sub

Resources