locked
Code Convert RRS feed

  • Question

  • How to convert the below code if I want to use Windows live Mail instead of Outlook

    Private Sub Submit_To_Warehouse_Click()

    'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm

    'Working in Office 2000-2013

        Dim OutApp As Object, OutMail As Object

        Dim rng As Range

        Dim StrBody As String

        StrBody = "Please prepare for the fullfilment of the below Sales Order:" & Chr(10)

        Application.ScreenUpdating = False

        Set OutApp = CreateObject("Outlook.Application")

        Set rng = Nothing

        On Error Resume Next

        Set rng = ActiveSheet.Range("A1:D11").SpecialCells(xlCellTypeVisible)

        On Error GoTo cleanup

     

                Set OutMail = OutApp.CreateItem(0)

                On Error Resume Next

                With OutMail

                    .To = ActiveWorkbook.Sheets("EmailReceiver").Range("B2").Value

                    .Subject = "Sales Order Data"

                    .HTMLBody = StrBody & RangetoHTML(rng)

                  

                    .Display  'Or use .Send

                End With

                On Error GoTo 0

                Set OutMail = Nothing

    cleanup:

        Set OutApp = Nothing

        Application.ScreenUpdating = True

    End Sub

    Wednesday, May 31, 2017 11:15 AM

All replies

  • Unlike Outlook, Windows Live Mail does not have a programming interface, so it is not possible to create an equivalent of this macro for Windows Live Mail.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Wednesday, May 31, 2017 2:25 PM
  • Hello,

    Our forum is used to discuss development issues related to Office object model, so your issue is out of scope. According to my search result, as Hans said, their is no API for Windows live Mail Desktop the default E-Mail Client and WLMailApi v1.0.1 allows developers to create custom Windows Live Mail plug-ins.

    Please visit the thread:

    https://social.msdn.microsoft.com/Forums/onedrive/en-US/f677883a-5d53-46f0-b71d-bdb0273a4c3f/windows-live-mail-api?forum=wlgeneraldev

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 1, 2017 3:08 AM