dbTalk Databases Forums  

Outlook, sendobject and VBA references

comp.databases.ms-access comp.databases.ms-access


Discuss Outlook, sendobject and VBA references in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter Morris
 
Posts: n/a

Default Outlook, sendobject and VBA references - 10-06-2011 , 06:36 AM






Hi everyone,

A few weeks ago, I posted a note about Outlook application coding to
which I have had some minor success. It's not there yet, but I'm
working on it. For whatever reason, the whole problem seems to go
deeper than I have any hope of understanding and no depth of Googling
forums or user other user groups etc has helped. I have tried
countless options, none of which have worked.

The long and short of it is that for ages, I have been successfully
using the sendobject option with absolutely no problems whatsoever, no
matter what email client was being used. Now, however, it's all come
crashing down. No matter what I am doing, I keep on getting an error
that I either cannot send (error 2293) and as of today, I am getting
an error 2046, the sendobject command is not available. Oh yeah, it
does not matter if I am coding for ACC2K on WinXP or Win 7; or ACC2010
on WinXP or Win 7, native mdb format for either option on either OS.
All clients now have either Outlook 2007 or 2010. Really oddly, I can
send for those clients who have ACC2010 runtime installed, but not for
those who have ACC2010.

So, today I went back to "first principles" and made a new db with a
single table (with only one field and entry - just felt like it), one
form, and one report and tried options of the following code to no
avail:

DoCmd.SendObject acSendReport, "main_rpt", acFormatHTML, , , , "test
send", "test message", , True

The form in the dev file has a single command button to email the
single report. On the dev file I made today, I keep getting the 2046
error, no matter what option I use eg acSendReport, acSendNoObject,
html, rtf, user email or not etc. Have I missed something in the
references? Currently I have :

VBA
MS Access 14.0 Library
OLE Automation
MS Access Active X data objects 6 library
MS DAO 3.6 Library

I understand and use the appropriate 9.0 libraries for those who are
not yet on Office 14 and the 14.0 libraries for those what are.
French parent company have not yet seen the light and upgraded all ;-
( Are there now global declarations etc I need to use?

So, any ideas and suggestions would be most welcome. I'm tearing out
what little hair I have left. C'mon, it has to be simple. Right?

Stinky Pete :-)

Reply With Quote
  #2  
Old   
Vacuum Sealed
 
Posts: n/a

Default Re: Outlook, sendobject and VBA references - 10-08-2011 , 06:15 AM






Hi Pete

Not at all sure if this is of any use to you.

Ron DeBruin has some excellent examples of Excel Coding for mailing.



He also has this

http://www.rondebruin.nl/cdo.htm


Why using CDO code instead of Outlook automation or SendMail in VBA.

1: It doesn't matter what Mail program you are using (It only use the SMTP
server).
2: It doesn't matter what Office version you are using (97.2007)
3: You can send a range/sheet in the body of the mail (some mail programs
can't do this)
4: You can send any file you like (Word, PDF, PowerPoint, TXT files,..)
5: No Security warnings anymore, really great if you are sending a lot of
mail in a loop.

HTH
Mick.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.