Automating 'From'

Hi all

From MS Access 2003, I have a routine in code that automates an email. I've 
tried posting in the outlook forums but no reply yet so I thought I'd try 
here too...

I can autofill the To, cc, subject, body field etc but now I need to also 
send
from a different user using the 'From' field. I tried adding this in the
same way to my code using:

 .From

but it seems this is not a supported method? I receive an Access error 438:
Object does not support this property of method.

Please can any one tell me if this is possible and if so how to do it? If I
don't automate this, and the user has to enter the from email address 
manually, it is very easy
for them to miss this and just hit send. This would result in it being
addressed as themselves, it is crucial that this does not happen as we are
sending the emails on behalf of a different company.

Thanks for your help...

Code snippets:

        Dim objOutlook As Outlook.Application
        Dim objEmail As Outlook.MailItem

        Set objOutlook = CreateObject("Outlook.application")
        Set objEmail = objOutlook.CreateItem(olMailItem)

        With objEmail
            .From = "Me@test.com"
            .To = "ME-" & dist
            .CC = "Me@test.com"
            .BCC = "fred;john;jane"
            .Subject = "Monthly Reports"
            .Body = "Test email please ignore... " 


0
Sue
6/7/2010 9:56:14 AM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
2392 Views

Similar Articles

[PageSpeed] 6

Can you possibly use CDONTS instead? Take a look at the simple example Tony 
Toews has at http://www.granite.ab.ca/access/email/outlook.htm

-- 
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"Sue" <sportybabesue@hotmail.co.uk> wrote in message 
news:%2306OreiBLHA.3608@TK2MSFTNGP05.phx.gbl...
> Hi all
>
> From MS Access 2003, I have a routine in code that automates an email. 
> I've tried posting in the outlook forums but no reply yet so I thought I'd 
> try here too...
>
> I can autofill the To, cc, subject, body field etc but now I need to also 
> send
> from a different user using the 'From' field. I tried adding this in the
> same way to my code using:
>
> .From
>
> but it seems this is not a supported method? I receive an Access error 
> 438:
> Object does not support this property of method.
>
> Please can any one tell me if this is possible and if so how to do it? If 
> I
> don't automate this, and the user has to enter the from email address 
> manually, it is very easy
> for them to miss this and just hit send. This would result in it being
> addressed as themselves, it is crucial that this does not happen as we are
> sending the emails on behalf of a different company.
>
> Thanks for your help...
>
> Code snippets:
>
>        Dim objOutlook As Outlook.Application
>        Dim objEmail As Outlook.MailItem
>
>        Set objOutlook = CreateObject("Outlook.application")
>        Set objEmail = objOutlook.CreateItem(olMailItem)
>
>        With objEmail
>            .From = "Me@test.com"
>            .To = "ME-" & dist
>            .CC = "Me@test.com"
>            .BCC = "fred;john;jane"
>            .Subject = "Monthly Reports"
>            .Body = "Test email please ignore... "
> 


0
Douglas
6/7/2010 12:13:50 PM
Thanks for the reply Doug, I will look at this now - not heard of it before. 
As long as it has the same capability (plus the From option) it might work 
for me. I need to be able to view the message first to check and edit, if 
required, before sending. We use MS Exchange and Office 2003 currently and 
this code was the only method I was aware of for sending emails. Thanks...

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> wrote in message 
news:huinqn$nih$1@news.eternal-september.org...
> Can you possibly use CDONTS instead? Take a look at the simple example 
> Tony Toews has at http://www.granite.ab.ca/access/email/outlook.htm
>
> -- 
> Doug Steele, Microsoft Access MVP
> http://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)
>
> "Sue" <sportybabesue@hotmail.co.uk> wrote in message 
> news:%2306OreiBLHA.3608@TK2MSFTNGP05.phx.gbl...
>> Hi all
>>
>> From MS Access 2003, I have a routine in code that automates an email. 
>> I've tried posting in the outlook forums but no reply yet so I thought 
>> I'd try here too...
>>
>> I can autofill the To, cc, subject, body field etc but now I need to also 
>> send
>> from a different user using the 'From' field. I tried adding this in the
>> same way to my code using:
>>
>> .From
>>
>> but it seems this is not a supported method? I receive an Access error 
>> 438:
>> Object does not support this property of method.
>>
>> Please can any one tell me if this is possible and if so how to do it? If 
>> I
>> don't automate this, and the user has to enter the from email address 
>> manually, it is very easy
>> for them to miss this and just hit send. This would result in it being
>> addressed as themselves, it is crucial that this does not happen as we 
>> are
>> sending the emails on behalf of a different company.
>>
>> Thanks for your help...
>>
>> Code snippets:
>>
>>        Dim objOutlook As Outlook.Application
>>        Dim objEmail As Outlook.MailItem
>>
>>        Set objOutlook = CreateObject("Outlook.application")
>>        Set objEmail = objOutlook.CreateItem(olMailItem)
>>
>>        With objEmail
>>            .From = "Me@test.com"
>>            .To = "ME-" & dist
>>            .CC = "Me@test.com"
>>            .BCC = "fred;john;jane"
>>            .Subject = "Monthly Reports"
>>            .Body = "Test email please ignore... "
>>
>
> 


0
Sue
6/7/2010 2:10:16 PM
From what I've read so far it doesn't look as though viewing the message is 
possible with CDONTS (or CDOSYS for Windows 2003 which we have). I send 3 
attachments which are created via PDF from 3 Access reports and added via 
code to the email, the email is also addressed to several people in the two, 
cc and bcc fields. The user wants to be able to double-check that all 
addresses etc are correct before sending (and currently the email body has 
not been decided upon but I know I can put this on an Access form too to 
collect). We could log in to a different account to send these messages but 
the email address we are using is a public folder and not an actual mailbox 
so this may not be possible.

I may have to just ask the user to be very careful and remember to change 
the 'From' field manually before sending...


"Sue" <sportybabesue@hotmail.co.uk> wrote in message 
news:ebrMoskBLHA.4388@TK2MSFTNGP04.phx.gbl...
> Thanks for the reply Doug, I will look at this now - not heard of it 
> before. As long as it has the same capability (plus the From option) it 
> might work for me. I need to be able to view the message first to check 
> and edit, if required, before sending. We use MS Exchange and Office 2003 
> currently and this code was the only method I was aware of for sending 
> emails. Thanks...
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> wrote in message 
> news:huinqn$nih$1@news.eternal-september.org...
>> Can you possibly use CDONTS instead? Take a look at the simple example 
>> Tony Toews has at http://www.granite.ab.ca/access/email/outlook.htm
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://www.AccessMVP.com/DJSteele
>> Co-author: Access 2010 Solutions, published by Wiley
>> (no e-mails, please!)
>>
>> "Sue" <sportybabesue@hotmail.co.uk> wrote in message 
>> news:%2306OreiBLHA.3608@TK2MSFTNGP05.phx.gbl...
>>> Hi all
>>>
>>> From MS Access 2003, I have a routine in code that automates an email. 
>>> I've tried posting in the outlook forums but no reply yet so I thought 
>>> I'd try here too...
>>>
>>> I can autofill the To, cc, subject, body field etc but now I need to 
>>> also send
>>> from a different user using the 'From' field. I tried adding this in the
>>> same way to my code using:
>>>
>>> .From
>>>
>>> but it seems this is not a supported method? I receive an Access error 
>>> 438:
>>> Object does not support this property of method.
>>>
>>> Please can any one tell me if this is possible and if so how to do it? 
>>> If I
>>> don't automate this, and the user has to enter the from email address 
>>> manually, it is very easy
>>> for them to miss this and just hit send. This would result in it being
>>> addressed as themselves, it is crucial that this does not happen as we 
>>> are
>>> sending the emails on behalf of a different company.
>>>
>>> Thanks for your help...
>>>
>>> Code snippets:
>>>
>>>        Dim objOutlook As Outlook.Application
>>>        Dim objEmail As Outlook.MailItem
>>>
>>>        Set objOutlook = CreateObject("Outlook.application")
>>>        Set objEmail = objOutlook.CreateItem(olMailItem)
>>>
>>>        With objEmail
>>>            .From = "Me@test.com"
>>>            .To = "ME-" & dist
>>>            .CC = "Me@test.com"
>>>            .BCC = "fred;john;jane"
>>>            .Subject = "Monthly Reports"
>>>            .Body = "Test email please ignore... "
>>>
>>
>>
>
> 


0
Sue
6/7/2010 2:40:47 PM
Reply:

Similar Artilces:

FRx Automation Error -196344
My users are running FRx 6.7.8069. (And GP 9.0) While Generating a report with e-mail output enabled they get the error Error -196344 Automation Error The object invoked has disconnected from its clients. I tried registering the dlls with no change. I can reproduce it on my PC. Any ideads where to start? We're on GP 9, FRx .9111. I periodically get that error, too, but when sending a report to the printer. I haven't figured out how or why I get it, though....it seems to happen if I've first sent several reports to the DrillDown Viewer, then try to print one from ...

Automate e-mail signature in CRM
It would be great to do automatic e-mail signature in CRM like Outlook without using the E-mail Templates. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=0c42f6bb-a6e9-48d...

Earn loads of money with this automated moneymaker
Hi, What do you think of that one. http://www.surfjunky.com/?r=HardToExist Earnings are 0.45 $ an hour. Multiply with 24 (I leave my computer online 24/7) and you 've got 10.80 $ a day. Monthly that's 324 $ !!! This without working a minute ! This without investing a dime ! This without any referrals ! Having referrals only makes it better ! Click the link below and give your paypal-account no opportunity to sleep anymore ! http://www.surfjunky.com/?r=HardToExist Level 1 Referrals - 5% Level 2 Referrals - 3% Level 3 Referrals - 1% ...

Re: Automation server can't create object.
Any1 have any ideas on whats causing this? "tech" <ap76@email.com> wrote in message news:... > Using OWA which used to work, but now I keep getting "Automation server > can't create object " after login in. > > Any ideas how I can resolve this? > > Many Thx. > > ...

Automate Serial NUmber transfer and Import Serial Number feature
I think you should have a feature to automatically send serial numbers when doing inter-store transfers . Presently you are sending the header information. You just need to fill in the serials. That will save lots of time. Also it will be a good idea to have a import utility to import serial numbers when you purchase items from suppliers . In many cases suppliers send serial numbers of the items in a txt file . So we can used this file to upload the serials instead of having to scan all these serials . rene.labban@thewizzcomputers.com Thanks ---------------- This post is a suggesti...

Automating adding/deleting rows and content with macros (I suppose
Hi all, I currently have three tabs on my Excel file, say "output1", "output2" and "database" in which information in the database tab will appear in the output tabs. Each row of information in the database tab will span a single row, and a number of columns. All such information will appear in only one of the two output tabs. Currently, whether such information appears in output1 or output2 depends on the formulas in the respective output tab. If output1 contains formulas that refer accordingly to the database tab while output2 doesn't, then...

How can l automate colours in a graph
Macros have been setup within excel so l can dump data into it and all the graphs update. There are colors assigned to certain categories however when you dump new data in we can't keep the colour we want with its category. The data is dumped from Access into excel Hi cbr1000, Not sure what you want to do, but if you are willing to use VBA you colud look at the 'Conditional Chart Formatting' example at http://www.edferrero.com/charting.aspx Ed Ferrero http://www.edferrero.com > Macros have been setup within excel so l can dump data into it and all the > graphs update....

Requisition Notifications
Add PO Number as an automated field in requisition notifications, so that emails can include the PO Number when users are notified that their requisition was transferred to Great Plains. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Business...

Automated Forex Trading, The Expert Advisors
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>The Forex currency exchange is getting more popular everyday, but everyone seems to think it is just evil, another way for the big corporations to stick it to the little guy.&nbsp; 95% of the people who trade forex <U>WILL LOOSE THEIR MONEY</U>, they will consistently give their money to the other 5% and they couldn't be happier.&nbsp; Now, with the introduction of forex currency tradin...

Sharepoint exposed in visio automation
Hi all, is sharepoint exposed in visio activeX control? ...

Outlook2007 automation problem with ".Display"
I am using automation in a VB5 program to send Emails using Outlook2007. If I use the ".Send" mailitem the email is sent out Immediately. If I use the ".Display" mailitem in my program, after I look over the Email and then click the "Send" button on the Outlook display screen, the email is placed in my outbox but does not get sent out. I have to exit my program and then click "Outlook". When Outlook displays, I can see the Email in the Outbox which will then automatically go out (without me having to click send and receive). I want th...

Automate Email Notification when Assigning Case to a CRM Queue
Using CRM 4, how can we automate an email being sent to an email address when a case gets assigned to a crm queue? I tried creating a workflow rule on the Queue entity to send an email when a new record is created but that really is only when creating a new queue, not an item in the queue. Any suggestions? The workaround I am using is let the workflow on a case creation event, assign the case to a queue and then send an email. This requires a field listing the queues that is selected in the Case. I still would like to have the ability to email after the Case is assigned to a queue. ...

public or shared calendar with automated appointment feed from users (Exch 2007)
Hi all, is it possible to set up a public calendar in Exch that does the following: Every time that a user (who belongs to a specified A.D. user group) posts a meeting/appointment to his\her personal calendar (the one one on the individual mailbox) if the appointment is public (vs. private) that appointment is automatically copied/replicated to a shared/public calendar that all the users of the AD group can see. Is it possible to set up something in Exchange or/and Sharepoint that does this? Would this entail writing some specific. thanks You would need a custom script....

Automating XP and IE8 Installation
I have used nLite and IEAK8 to create an XP Pro installation CD that includes SP3 and all recent updates, and automatically installs IE8 with a number of settings configured. I have tested the CD and found that it works, but that there are a number of things that did not get setup correctly. I am thinking that some of these may require registry settings. I would like to have the following settings automatically configured: 1) Enable the Quick Launch and Desktop toolbars 2) Define network connections (nLite would seem to allow this, but it didn't work for some reason) 3) Incl...

*** New How-To Article Posted
I have hacked together a way to automate / script Exmerge. This allows you to backup all of your user mailboxes to .PST files. We use this as a free way to perform "brick level" backups. This is a type of backup where each mailbox is individually backed up. It makes it easy to setup a restore of an individual mailbox. When using this hack, plus performing backups with NTBackup, you can perform full exchange backups without 3rd party backup software. This should save $$$ in many small organizations. http://www.castellan.net/exmerge_automation.html ...

Excel Automation
I can delete a sheet using the code below, is it possible to automate this process? To create this report takes about 5 mins to proccess all the sheets and generate a summary, after this i need to delete the scratch pad sheets and continue the automation and sent the report with Outlook. Dim AppOutLook Dim MailOutLook Dim olmailItem Set AppOutLook = CreateObject("Outlook.Application") Set MailOutLook = AppOutLook.CreateItem(olmailItem) Dim Excel_Application As Excel.Application Dim Excel_Workbook As Excel.Workbook Dim Current_Worksheet As Excel.Worksheet DoCmd.TransferS...

Automate bar chart color based on value postive or negative
Is there way to automate a bar chart color based on value postive or negative. for example if the value is postive change the bar chart color to green, if the value is negative change the bar chart color to red. Hi, I have some instructions on how to get the invert if negative option to work as expected. http://www.andypope.info/charts/Invertneg.htm Cheers Andy kathy wrote: > Is there way to automate a bar chart color based on value postive or > negative. for example if the value is postive change the bar chart color to > green, if the value is negative change the bar chart...

Automated starting of app
Hi NG, I don't know if this a problem special to MFC or something else. I work with XP and VC++ 6.0. I wrote a small dialog based app which can collect names of files and/or directories. I can start this app and select the files and directories with the usual common dialogs - works fine. I can also mark the files in the explorer and dragdrop them to the icon of the app. In this case I get the names as argv[n] and can fill the dialog with them while the program is starting. Works fine too. But when I select too many file names to dragdrop them to the icon, while the program starts I get the...

automate creation of mailboxes for exisitng accounts
I've been looking for a script that will create mailboxes for exisitng accounts in active directory. has anyone seen or used a script that will do this? thanks in advance.. HOWTO: Create a Mail-Enabled User with CDOEXM in Visual C++ ID: 293339 The GUI will allow you to mailbox-enable several at a time as well. This assumes Exchange 2000 or 2003. -- Hope that helps, Dan Townsend This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send email to this address, post a reply to this newsgroup. Use of included script samples are subject to...

access reports automation
can some one guide me how to open an access repot 97 using office object model and read the variables in the report using VB.NET thanks sri There are instructions for how to do it from VB in the following KB articles: ACC: How to Use Automation to Print Microsoft Access Reports: http://support.microsoft.com/default.aspx?scid=kb;[LN];145707 ACC: Using Microsoft Access as an Automation Server (Q147816) http://support.microsoft.com/default.aspx?scid=kb;[LN];147816 Hopefully you'll be able to translate those instructions to .Net. -- Doug Steele, Microsoft Access MVP http://I.Am/DougS...

Automate visio with ASP.NET
Hi, Is it possible to automate visio with ASP.NET? I am able to do that for .NET windows application. Whereas the same code for ASP.NET does not work. Any settings that we should take care of? Kindly suggest Regards, Rajesh ...

Good automated testing tool for command line applications?
Does anyone know of any really good automated testing tools for command line applications? The tool only needs to be able to read text from the command line display screen, and enter keystrokes both of these from a script file. "Peter Olcott" <NoSpam@SeeScreen.com> wrote in message news:vqgmi.481955$g24.460757@newsfe12.phx... > Does anyone know of any really good automated testing tools for command > line applications? The tool only needs to be able to read text from the > command line display screen, and enter keystrokes both of these from a > script fil...

Automating task due dates into outlook calendar
Is there a way of automatically adding the task due dates to the outlook calendar? I know it can be done manually but can it be done automatically? ...

Using Access Excel Automation, can I delete or rename a worksheet
Hi I am using automation to produce an excel workbook from an access database. Everything is working fine, except that my workbooks always have 3 additional worksheets - sheet 1, sheet 2 and sheet 3. Can I delete these, or rename them? Stapes On 13 Sep, 11:04, Stapes <steve.sta...@gmail.com> wrote: > Hi > > I am using automation to produce an excel workbook from an access > database. Everything is working fine, except that my workbooks always > have 3 additional worksheets - sheet 1, sheet 2 and sheet 3. Can I > delete these, or rename them? > > Stapes Found ...

Compound Document Support and Automation in MFC Wizard
Hi There are 2 similiar(I think) options in MFC App. Wizard. In one step we can set Compound Document Support and in Advanced Features page we can check Automation. But aren't they to support COM technology? Why are there 2 different places to add support? What is the difference between these 2 options? Thanks.. Thanks... Compound Document Support means you can include, for example, an Excel spreadsheet in your app. Automation support means that another program can control yours via automation. Therefore, they are solving two different problems. You might have a completely standa...