+ Reply to Thread
Results 1 to 3 of 3

Body message - email

  1. #1
    al007
    Guest

    Body message - email

    Sub Mail_workbook_KI()

    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dayrep = InputBox("Enter no. day of report.", Default:="0")
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    With OutMail
    .To = "[email protected]"
    .CC = ""
    .BCC = ""
    .Subject = Dayrep & "Day Revenue Report"
    .Body = "'Please find attached the ' & dayrep & ' day report
    '"
    .Attachments.Add ActiveWorkbook.FullName
    'You can add other files also like this
    '.Attachments.Add ("C:\test.txt")
    .Send 'or use .Display
    End With
    Set OutMail = Nothing
    Set OutApp = Nothing
    End Sub


    Having problem with the body message - want it to read: 'Please find
    attached the 10 day report - if Dayrep=10

    Can anybody help pls


  2. #2
    NickHK
    Guest

    Re: Body message - email

    al007,
    Double quotes ", instead of single '.
    Also, Option Explicit is your friend; you would have seen "dayrep" was not
    being evaluated.

    NickHK

    "al007" <[email protected]> wrote in message
    news:[email protected]...
    > Sub Mail_workbook_KI()
    >
    > Dim OutApp As Outlook.Application
    > Dim OutMail As Outlook.MailItem
    > Dayrep = InputBox("Enter no. day of report.", Default:="0")
    > Set OutApp = CreateObject("Outlook.Application")
    > Set OutMail = OutApp.CreateItem(olMailItem)
    > With OutMail
    > .To = "[email protected]"
    > .CC = ""
    > .BCC = ""
    > .Subject = Dayrep & "Day Revenue Report"
    > .Body = "'Please find attached the ' & dayrep & ' day report
    > '"
    > .Attachments.Add ActiveWorkbook.FullName
    > 'You can add other files also like this
    > '.Attachments.Add ("C:\test.txt")
    > .Send 'or use .Display
    > End With
    > Set OutMail = Nothing
    > Set OutApp = Nothing
    > End Sub
    >
    >
    > Having problem with the body message - want it to read: 'Please find
    > attached the 10 day report - if Dayrep=10
    >
    > Can anybody help pls
    >




  3. #3
    al007
    Guest

    Re: Body message - email

    It does not work - pls give me correct code
    thxs

    NickHK wrote:
    > al007,
    > Double quotes ", instead of single '.
    > Also, Option Explicit is your friend; you would have seen "dayrep" was not
    > being evaluated.
    >
    > NickHK
    >
    > "al007" <[email protected]> wrote in message
    > news:[email protected]...
    > > Sub Mail_workbook_KI()
    > >
    > > Dim OutApp As Outlook.Application
    > > Dim OutMail As Outlook.MailItem
    > > Dayrep = InputBox("Enter no. day of report.", Default:="0")
    > > Set OutApp = CreateObject("Outlook.Application")
    > > Set OutMail = OutApp.CreateItem(olMailItem)
    > > With OutMail
    > > .To = "[email protected]"
    > > .CC = ""
    > > .BCC = ""
    > > .Subject = Dayrep & "Day Revenue Report"
    > > .Body = "'Please find attached the ' & dayrep & ' day report
    > > '"
    > > .Attachments.Add ActiveWorkbook.FullName
    > > 'You can add other files also like this
    > > '.Attachments.Add ("C:\test.txt")
    > > .Send 'or use .Display
    > > End With
    > > Set OutMail = Nothing
    > > Set OutApp = Nothing
    > > End Sub
    > >
    > >
    > > Having problem with the body message - want it to read: 'Please find
    > > attached the 10 day report - if Dayrep=10
    > >
    > > Can anybody help pls
    > >



+ 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