send report by outlook

amna77

Active Member
Joined
May 9, 2002
Messages
251
I have one DMR report. Basically when I click on the report button it sends the report to all people listed in there.
But one thing, the subject of the report comes to bcc line, insted of stubject line. I am using Microsoft outlook.
below is my code line, please help me.
Thanks

Private Sub Command80_Click()
DoCmd.SendObject acSendReport, "rptDMRFullLocationDaily", acFormatRTF, "CSkinner@eg.trendtechnologies.com;MKansfield@eg.trendtechnologies.com;ImaniT@eg.trendtechnologies.com;gmcardle@eg.trendtechnologies.com;RKothari@eg.trendtechnologies.com", "jsippy@eg.trendtechnologies.com;richw@eg.trendtechnologies.com", , "Daily DMR Location Report for " & DateAdd("d", IIf(Weekday(Date) = 2, -3, -1), Date), , False
End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
It might be best to break down your code to more manageable statements and qualify each parameter. I know it's not necessary, but it would certainly be more readable to have something like this: -

Code:
Private Sub Command36_Click()
Const strObjName As String = "rptDMRFullLocationDaily"
Dim strRecipients As String
Dim strSubject As String
Dim strCopyTo As String

strRecipients = "CSkinner@eg.trendtechnologies.com;MKansfield@eg.trendtechnologies.com;"
strRecipients = strRecipients & "ImaniT@eg.trendtechnologies.com;gmcardle@eg.trendtechnologies.com;"
strRecipients = strRecipients & "RKothari@eg.trendtechnologies.com"
strCopyTo = "jsippy@eg.trendtechnologies.com;richw@eg.trendtechnologies.com"
strSubject = "Daily DMR Location Report for " & DateAdd("d", IIf(Weekday(Date) = 2, -3, -1), Date)

DoCmd.SendObject acSendReport, strObjName, acFormatRTF, to:=strRecipients, cc:=strCopyTo, _
subject:=strSubject, editmessage:=False

End Sub
 
Upvote 0

Forum statistics

Threads
1,221,575
Messages
6,160,603
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top