Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Body message - email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
al007 - 24 Jan 2006 09:59 GMT
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 = "transferxxx@gmail.com"
       .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
NickHK - 24 Jan 2006 10:07 GMT
al007,
Double quotes ", instead of single '.
Also, Option Explicit is your friend; you would have seen "dayrep" was not
being evaluated.

NickHK

> Sub Mail_workbook_KI()
>
[quoted text clipped - 23 lines]
>
> Can anybody help pls
al007 - 24 Jan 2006 11:08 GMT
It does not work - pls give me correct code
thxs

> al007,
> Double quotes ", instead of single '.
[quoted text clipped - 30 lines]
> >
> > Can anybody help pls
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.