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
2282 Views

Similar Articles

[PageSpeed] 52

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:

Automated E-Mail Message from Inside Excel
Is there anyway to embed/generate an automated e-mail notification when a date is reached within an excel spreadsheet Thanks in advance!!!! Hi walt See your other thread in Functions I change my answer after reading it a second time -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "walt" <walter.adasczik@hanscom.af.mil> wrote in message news:050001c356e2$fc17ed50$a401280a@phx.gbl... > Is there anyway to embed/generate an automated e-mail > notification when a date is reached within an excel > spreadsheet > > Thanks in advance!!!!...

automate creation of sheets in excel
automate creation of sheets in excel is there anyway to automate creation of sheets in excel? I would like to have one sheet that has a master list of all items. then a have sheets which are automaticaly generated, 1 sheet for every 30 items on the master sheet. can this be done? is there some vba built into excell that i could use to do this? You could try something like this, Daniel: http://www.vbaexpress.com/kb/getarticle.php?kb_id=318 ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Daniel" <softwareengineer98037@yahoo.com> wrote in mess...

Using a Macro to automate Charts
Good Day, How can I use a Macro to create charts which would have different series length. Thus, it would create a chart for 10 yr period then witha change of data re-create a chart for a 2 yrs period ...and so on. Thanks for all your help Llednar [This followup was posted to microsoft.public.excel.charting and a copy was sent to the cited author.] For a non-programmatic solution check the the 'Dynamic Charts' page of my web site. -- Regards, Tushar Mehta MS MVP Excel 2000-2003 www.tushar-mehta.com Excel, PowerPoint, and VBA tutorials and add-ins Custom Productivity Solut...

Line Automation
I am using Excel 2000. I have created spreadsheets named Lunch and Breakfast.that has 5 rows and 6 columns. These sheets are updated weekly (data input: 8/1 - 8/ 5 on separate lines with $ collected etc.) I need to create a monthly spreadsheet that will result in a monthly report for each spreadsheet identified above. Is there a way to have the monthly spreadsheet automatically move down a line? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/ms-excel/200508/1 Could you describe in more detail what's on each worksheet by row and column? Richard Lenora ...

Automated sales reports via email
Has anyone developed an add-on to automatically send a daily detailed sales report via email? Sure do! On demand AND at set times. Drop me a message offline to discuss. sbinder @ venus.com "Gaz" wrote: > Has anyone developed an add-on to automatically send a daily detailed sales > report via email? ...

automating order fullfillment
Has anyone used integration Manager or another tool to update sales orders with fullfillment information from a csv file or from a sql table? I am getting information from a warehouse as t o what has been shipped. I want to them update GP without having to pull up every single order and fullfill them one at a time. I think I can fullfill by batch but what about partial shipments? -- Phil Hi Phil, If you are interested we can offer a custom solution for your requirement. Regards, Manick manick.m@hotmail.com "Phil" wrote: > Has anyone used integration Manager or anot...

automation, choose e-mail account
Hi there, I am using automation in MS Access to send e-mails through outlook, this is working fine. The e-mails are send through the default e-mail account (there is several of them) Does anyone knows the code (VBA) to choose/select the account with which the e-mail will be sent? Thanks Philip ...

Automating Word from VC++
Anyone have experience automating word from VC++ .?? I nedd specific help in dividing a report consisting of say 3 tables, into 3 sections, and then setting the headers for each page in the report. My footers are ok..got that part working. I have a logo (.jpg) in header I want ONLY in first page of report, butmy problem is it is in ALL pages. I want to be able to setup different headers for first page of each section and headers for the rest of a particular section. Here is my code that doesn't work yet...the population of the table(s) is not shown...Just need some guidance as t...

Word Automation
Bug Report (can't find out how to submit bug reports other than here) Summary of bug - Word 2007 automation object throws error 5174 with any filename that has the pound sign (#). I have run into this bug only when using the Automation object for Microsoft Word 2007. I have not tried this with other versions of Word. The file I am opening is a "doc" file, NOT a "docx" or "docm". The filename contains a pound sign (#). I am able to open this file using any other method (File->Open; double-clicking from Windows Explorer; etc). But when opening ...

Automate sync deactivating
We've got about 40,000 contacts in our CRM 3.0 implementation with about 30 owners. We would like to disable the syncing of contacts and the removal of the CRM-sourced contacts in Outlook in an automated fashion. Is there a way to do this? We could go around to all of the workstations, but would prefer a script or something to handle it. I tried playing around with the SyncContact registry setting in the HKCU\Software\Microsoft\MSCRMClient key, but it didn't seem to have an effect. Also, to prevent these from happening in the future, can the installs be set to default with ...

Import and Save Automation
I am very new to working with complex excel functions and I am looking for a guide to help me complete the following task, and I would also like to know if the following is possible. Currently my company creates a usage report for users for each month. We take those numbers manualy type them into another excel sheet that totals up the cost for the month. Then we create an invoice for customers, again in excel. What I would like to do is. 1. Create our usage report as normal. 2. Import that usage report into the excel sheet that does the cost caluculations, and have the costs be calcula...

Automate another app
I have been programming in VB (classic) for many years and am quite familiar with how I would accomplish this in that enviornment. However I just started using C# and have no clue. For starters in VB I would start the other application by calling the Shell function. Then to actually control the other app I would first locate the window handle for controls I wanted to interact with using Win32 APIs which allow me to retrieve the hWnd for a window given its ControlID (gathered from Spy++). I would then use the SendMessage API (with the appropriate message constant) to enter text in edi...

Exporting selected data / automation
Hello, Like so many others, I am an Excel newbie. I was a mainframe COBO programmer in another life, but that was a few years back :rolleyes: My manager would like me to write an app that will take data from a existing Excel spreadsheet (generated by our system), select only handful of columns, write out a new spreadsheet with the selected data and then the new spreadsheet will be used as input to a new Acces database that I will create. 1) How do I select which columns I want to export? I tried highlightin the columns and then doing a "Save As..." but that just gave me an ex...

Compiling automated report from stocklist
Hi all, I'd like to make a big list with items, one item per row, multiple properties and one column that states howmany I ordered. On the next tab I'd like an automated report, displaying each line if and only if I ordered something. I somewhat managed to do that with an advanced filter but that's not exactly what I want. It's not updated when I order some other items. How should I approach this? Data > Filter > AutoFilter, and select "non-blanks" in the column giving your order quantity. Vaya con Dios, Chuck, CABGx3 "webhead" wrote: > Hi...

Adding automated content to existing fields
We have a database for our recieving department. For each package recieved, a lot number is assigned and typed in. Now we are looking to automate the lot number, having an automatic lot number generated and added when a package is recieved. I can generate the automatic number, but is there any way to do this and use the existing field? I don't want to disturbe the previous data for tracking purposes. If I can't figure this out, I will need to add a new field and searches become more complicated. Any suggestions? "Orlan" <Orlan@discussions.microsoft.com> wr...

Next automation question: keeping my app active
When I execute a go-to-slide operation via PowerPoint automation, the PowerPoint presenation pops to the top (desirable) and becomes the active app (undesirable). I've tried all of the tricks I know of to try to get focus back to my app and keep it active, but none of them seem to work because PowerPoint is off *becoming* active; when it finally gets around to activating, it steals focus from me. Short of something grotesque, like a timer polling for deactivation and forcing reactivation, I'm stuck. Any automation gurus have an idea of a better way to handle this? thanks joe...

automate generation of many charts
Hi I am trying to build a desktop application that will auto-generate graphs for us, based on the table below. The figures relate to usage levels per part. There are about 8000 rows, and i require a graph for each ROW ! The title of the graph is the part number, the first line on the graph is the usage per period, and the second line is the average usage which is drawn across all periods. the x-axis labels is 'period n', per column. PartID Description Period 10 Period 11 Period 12 AverageUsage 00100019 SCREW 0.05 0...

How to automate payee to a certain category
Just downloaded 6 months of credit card charges. None of them imported a category. How can I automate say the 13 Shell Oil purchases in the register to have the same category like "gasoline" or at least have gasoline in the category when it is edited in the register? In microsoft.public.money, cl wrote: >Just downloaded 6 months of credit card charges. None of them imported >a category. How can I automate say the 13 Shell Oil purchases in the >register to have the same category like "gasoline" or at least have >gasoline in the category when it is edited i...

Automated Data Collection screen in MFG, default times
I would like to see a setup option for defaulting the time to the work station's time (start & finish). Are there any 3rd party ADC options? Thanks ...

Automating the conversion of a lead to a contact
I need to build a CRM add-in that will automate the conversion of a Lead to a Contact and assign a specific Salesperson as the owner. Any recommendations on the best way to approach this? Thanks! David Could you describe the scenario you want? I think you could simply use workflows to do this (on LEAD CREATE),although I need to check. >-----Original Message----- >I need to build a CRM add-in that will automate the >conversion of a Lead to a Contact and assign a specific >Salesperson as the owner. > >Any recommendations on the best way to approach this? > >Tha...

automation
Through the help of the link http://msdn2.microsoft.com/en-us/library/aa159619(office.11).aspx on automation I can create through the use of an access form an appointment in Outlook. This is sent and added automatically to my outlook calendar. My question is does anyone know if there is a way to add this appointment also to a collegues calendar in the case we need the go with the 2 of us. Kind Regards, Ruud I'm not sure, but you may want to ask your question in the outlook forum. They are more experienced programming outlook and propably better positioned to give you an answer. --...

automation with outlook 2007
I have mulitple office versions installed (Access 97, 2000, 2003, Office 2003, Office 2007) Unitl recently automation to Outlook 2007 from Access worked (in Access 2003) However something (update, installation of visio, project 2003,...?????) created an issue. Any of my code trying to create the outlook object gives the following kind of error: "automation error, the specified module could not be found" The reference is set to "C:\Program Files\Microsoft Office\Office12\MSOUTL.OLB", this file is still there at the indicated place by the reference. Is there any way to regi...

Strange PowerPoint Automation interface failure
VS.NET 2003, talking to PPT 2003 When I open some presentations, using presentations.Open, everything works fine, but in other presentations, it throws a COleException whose code is 'Type mismatch'. The call is presentations.Open(filename, 0, 0, 1) Specifically, the code is try { /* try */ CPresentations presentations; // From CPresentations.h, the presentations coll. CPresentation presentation; // From CPresentation.h CString uname = filename; uname.MakeUpper(); // convert ot all-uppercase HERE(); // part of my de...

Best approach to automate recurring order/invoices
We have multiple customers set up for different frequencies of billings- some annual and some quarterly. Each month a different set of invoices need to be processed as annual or quarterly billing can commnece any month. What will be the best approach to automate this process? ...

Automating
Hi, I have 8 Excel Spreadsheets that gather data from an External Data Source. I'd like to somehow schedule these files to open, refresh the data, and then close some stage at night so the data is fresh for when the user gets in. (it takes about 5 minutes to update each workbook). Does anyone have any ideas? Thanks Marek "Marek" <nospam@spam.spam> wrote in message news:efSC%239iwEHA.908@TK2MSFTNGP11.phx.gbl... > Hi, > > I have 8 Excel Spreadsheets that gather data from an External Data Source. > I'd like to somehow schedule these files to open, ...