Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2003, 07:58 PM
Authorized User
 
Join Date: Jun 2003
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default SendObject with a variable

Does anyone know how to get the SendObject method to accept a variable as opposed to a string..? I am trying to send email to specific people depending on specific criteria and the only option I have (other than a really lengthy if then .. else or Select Case structure) is SendObject.

Any assistance of suggestions would be greatly appreciated.

Kenny Alligood
__________________
Kenny Alligood
 
Old July 26th, 2003, 02:11 AM
Registered User
 
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Kenny Alligood
 Does anyone know how to get the SendObject method to accept a variable as opposed to a string..? I am trying to send email to specific people depending on specific criteria and the only option I have (other than a really lengthy if then .. else or Select Case structure) is SendObject.

Any assistance of suggestions would be greatly appreciated.

Kenny Alligood
I presume you are referring to

Public Const E_SUBJECT As String = "E Report"
Dim sReportName as String
Dim sMsg As String
Dim sRecip As String
Dim sCc As String
sReportName = "rptConsolidation"
sRecip = "[email protected]"
sCc = "[email protected]"
sMsg = "The SendObject method silently fails. " & _
"See http://support.microsoft.com/default.aspx?scid=kb;en-us;260819"

DoCmd.SendObject ObjectType:=acSendReport, _
  ObjectName:=sReportName, _
  OutputFormat:=acFormatRTF, To:=sRecip, CC:=sCc, _
  Subject:=E_SUBJECT, MessageText:=sMsg, _
  EditMessage:=True

It works for me. But be warned sMsg can't be very long!
Check Microsoft Technet #Q260819 (it's the URL above)
Otherwise you have to go to plan B.
Microsoft seems to have dropped this one in mid-stream
in their rush to the WEB.
What do you expect from a MONOPOLY!
 
Old July 30th, 2003, 07:37 AM
Authorized User
 
Join Date: Jun 2003
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx for the input WmFay -- it worked the charm!!

Kenny Alligood
 
Old July 31st, 2003, 07:12 PM
Registered User
 
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Glad to help!

About a year ago, I was running into about one of these per WEEK! for 4 weeks. Too bad anyone has to put up with this kind of stuff just because the folks at Microsoft ase so sheepish about these kinds of situations. Of course IBM has been the same way. They call them "Interesting Situations" not bugs or problems!

Keep the faith (;))





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
assign javascript variable to asp variable manjunath_c_k Classic ASP Basics 1 September 14th, 2006 07:35 AM
Object Variable or With Block Variable Not Set Iashia06 Access 1 May 22nd, 2006 10:24 AM
SendObject Not working bidatad Access VBA 0 March 29th, 2005 04:02 PM
add image to report and send with DoCmd.SendObject marcin2k Access VBA 1 February 22nd, 2005 12:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.