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 7494 articles. 0 followers. Follow

3 Replies
1554 Views

Similar Articles

[PageSpeed] 11

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:

Automation
Hello Everyone, Recently our IT group installed service pack 3 on our computers. I wrote some code in word that automatically attaches it self to an outlook email and sends it out. I'de like to disable two windows that i didn't get before they installed service pack 3 there are not titles so here is a description of the boxes: 1 - A program is trying to access email addresses you have store in outlook. do you want to allow this? then it asks for "allow access for" (1,5,10 minutes) 2 - then i get a similar one that just asks you if you're sure you want to send ...

CRM and Fax automation question
Hi, I'm looking for a good or better fax server that can be easily and seamlessly integrate with MS CRM 3.0 or 4.0. I'm thinking of RightFAX or GFIFax... or even if I install these fax server in my environment, do I still need to do programming and customizations, such as post callout when a new Fax activity is created? Please advise :) You immediate response is appreciated. "Benjamin Fallar III" <fallar@pldtdsl.net> wrote in message news:3484C69D-B193-4B48-86A4-A4529D9DE4C6@microsoft.com... > I'm thinking of RightFAX or GFIFax... or even if I install ...

Provisioning/Automation tools for Exchange??
I have been asked to find some tools possible of automoating mailbox moves to specific databases/storage groups based on the department of a user for instance. Let's say User1 is part of HR and has transferred to Marketing. All the HR mailboxes reside on SG1 DB1 and all Marketing reside on SG1 DB2. Is there any software anyone knows of that can read the department attribute from AD and then move the mailbox according to defined rules you put in place. Any and all help appreciated! Mike In a couple of situations, organizations I have worked in have talked about having something li...

Is it Possible to Automate a Graph?
I have a sheet that has data in weekly fashion in the first and second rows. (Row 1, week: Row 2, data.) Is it possible to have a graph populate off of the information in rows 1 and 2 that automatically includes data for new weeks as they are entered in to the sheet? For example, I want to create a graph for weeks 1 through 3 now, and want the chart to automatically update if I add data for week 4. Row 1 Week 1 2 3 Data 12.5 17 18 Thanks for the assist! -Adam Use a defined name using the offset function for your series --...

Way to automate adding pictures in a series in Excel?
I'm putting a column of pictures of people next to a column with their names. If I have the pictures together in a folder, with the photo file names numbered with the corresponding row numbers that the pictures go in, is there a way to record a macro so that (for instance) 28.jpg will go into the picture column in row #28, then 29.jpg will go into the picture column in row #29, etc. In other words, insert a whole series of pictures (filenames the same as their appropriate row numbers) in their correct places, by initiating one macro? If anyone has any idea of how that could be done, I wou...

Automating transfers, is this possible?
Hi All. I am using MM 2007 Premium and I'm using Advanced Bills. In "Help" it says .... "Make electronic transfers. Set up automated transfers between any accounts you track in Money" I have a set up an "xfer" from my checking to my savings (same bank) to occur once a month but Money doesn't actually do anything unless I manually go to "Bills Summary", check it and and click "Pay Online". This isn't what I would call an automated transfer. Is there any way to actually make this happen? Thanks, Richard ----== Posted via ...

VBA automating Word from PowerPoint 11-22-09
I have an add-in macro that exports PPT content to a new Word document for each PPT file in the same folder as the currently open PPT file. I've noticed that when the macro is finished, and I go to Word, Word seems "paralyzed" (I can't use any menu commands or close the doc). If I Alt+Tab back to PowerPoint, and then Alt+Tab back to Word, all is well. Is there something about automating Word from PowerPoint that needs to be "cleared" when the PowerPoint macro ends - some way to release PowerPoint's control over Word? I found http://www.pptfaq.com...

automation
Hi there; I am copying specific cells from a file (actuallu use the address approach, like aa!c12) to another file. The cells address in source file are always the same, but in target file changes each time to lower rows than previous one. I have 100 source files at least, how to automate this, instead of clicking at each cell each time between source and target files. Thanks for your help. in your target file, use dir to get the first source file, copy the cell(s) desired, close this source file, use dir() to get 2nd file and repeat till finish "Darius" wrote: > Hi there; ...

How To Call Automation Methods with SAFEARRAY** [out]
I have a COM component has such interface: STDMETHOD(GetErrList)(SAFEARRAY** pALarr, SAFEARRAY** pVLarr); How can I consume it from MFC ? Thanks! First, add a new class to your project by using either Class Wizard (in VC6.0) or by right-clicking on the project in the class view. Select "Add Class". In the next dialog select "From Type Library". Select your COM library file. Click OK. This will generate a new MFC class that's derived from COleDispatchDriver. It will also have a set of methods implemented, that invoke your COM object methods. Use them at your ...

Automated Stock Allocation Automation
Hi I have to write a integration procedure that performs stock allocation to Back Orders on Great Plains. This can currently be done by using the eEnterprise application, but I was wondering if I can do it automatically using eConnect Thanks ...

Word Automation; template showing up
I have a document set up as a template for mail merge using data from a table in access. Everything is working, except when the document opens up for the user to view, so does the template, so you have to different word documents opening up. Is there a way to avoid this. I am just wanting the user to see the merged document in the print preview format. I have included my code below. I appreciate any time and advise on this... Dim objWord As Word.Document Set objWord = GetObject("G:\Users\AJ\Testing.doc", "Word.Document") objWord.MailMerge.OpenDataSource _ ...

Automate Paste Special Values
Hi- I'm working on a ticketing spreadsheet with serial numbers in one column (derived from a formula). When I copy the serial number & paste it, I also copy the formula. Using paste special and selecting the values option I can get the serial number to paste into a cell without the formula. I also need this value to be placed in clipboard memory to I can use the value in an older windows program. Is there any way to run a macro, vba, etc. that will do this for me? Thanks in advance. I think I'd add the Paste|values icon to my favorite toolbar. tools|customize|Edit Category ...

How to automate backup
Is there a way to automate the backup of the isv.config, web.config, and all 6 databases into BAK files onto disk? Perhaps NTbackup for the files? And the databases? Thanks Use SQL Server maintenance plans to backup your databases to a folder on your server and use any commercially available backup product such as BackupExec to backup the files. -- Matt Wittemann, CRM MVP http://icu-mscrm.blogspot.com "circulent" wrote: > Is there a way to automate the backup of the isv.config, web.config, and all > 6 databases into BAK files onto disk? Perhaps NTbackup for the files...

Automation
How can i take an instance of an already running application (like excel or AutoCAD) using GetActiveObject function ? The following code fragment doesn't work! CLSID clsid; CLSIDFromProgID(L"Autocad.Application", &clsid); // Get an interface to the running instance, if any.. IUnknown *pUnk; HRESULT hr = GetActiveObject(clsid, NULL, (IUnknown** &pUnk); ASSERT(!FAILED(hr)); // Get IDispatch interface for Automation... IDispatch *pDisp; hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDisp); ASSERT(!FAILED(hr)); // Release the no-longer-needed IUnknown.....

VBA code needed to AUTOMATE SELECTION of names within VALIDATION dropdown then print
I have searched the blogs and cannot seem to locate anything related to my challenge. I know you guys are gurus when It comes to things like this. I have a worksheet that tracks employee productivity for each cost center with a region. My excel worksheet contains three validation dropdowns that use the "indirect" function with various named ranges that link these dropdowns . So for instance lets say that the first dropdown relates to a region, the second relates to a cost center (there can be many cost centers in a region), and the third is a worker in that cost center (there can...

automation of sharing records
Anyone know whether the automation of sharing records in CRM is possible in 1.0? Doesn't look to me like it can be done in Workflow. Would like Account and Lead records to be shared to certain users when record's owner condition is met. Thanks, --d. It can be done with Post-Callouts Mike "Davi" <davida.arnold@datareturn.com> wrote in message news:%23M5qjXZxDHA.3116@tk2msftngp13.phx.gbl... > Anyone know whether the automation of sharing records in CRM is possible in > 1.0? Doesn't look to me like it can be done in Workflow. Would like > Account an...

automator
Office 2008 for Mac says all its parts support Automator (in OS10.4.x) but I can;t make it work - Auto doesn't acknowledge Office at all. Any help gratefully received! On 3/3/08 11:10 AM, in article ee8f88e.-1@webcrossing.caR9absDaxw, "miktaylor@officeformac.com" <miktaylor@officeformac.com> wrote: > Office 2008 for Mac says all its parts support Automator (in OS10.4.x) but I > can;t make it work - Auto doesn't acknowledge Office at all. > Any help gratefully received! There were some big changes in Automator from Tiger to Leopard. It could be the Automator ...

DPM 2010 RC automated install
Hello all. I am in the process of trying to get an install package for a base DPM install. Has anyone been successful at this? I've created an answer file with the following options created. Can anyone chime in? Any info would be appreciated! [OPTIONS] UserName=User name CompanyName=Company name ProductKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx SqlAccountPassword=Password~1 StandardAgentLicenses=10 EnterpriseAgentLicenses=10 ProgramFiles=C:\Program Files\Microsoft Data Protection Manager DatabaseFiles=C:\Program Files\Microsoft Data Protection Manager\DPM\DPMDB IntegratedInstallSo...

automate
does any one now how to set out look to save an attachent to to a network share thanks in advance You can try using CaSaveAtt along with the Rules Wizard to do that: http://www.ornic.com/actions/casaveatt.shtml "newbie" <roy@hotmail.com> wrote in message news:OTJyH0ulDHA.2232@TK2MSFTNGP09.phx.gbl... > does any one now how to set out look to save an attachent to to a network > share ...

Automation
Our Accounts Payable person uses OLE notes to attach scanned documents to invoice documents in Great Plains. This is a tedious process. Here is what I would like to automate if possible: Display the invoice that I want to add a scanned document to. Click on the note field next to the invoice number. Click on the paperclip and open the OLE Notes Container. Choose Edit/Insert Object Choose From File Enter a path so that the Browse button goes directly to the correct folder for document selection. If I could get that much of this process automated, it would help our AP person. I've...

Attatchment Retrieval Automation
I can't seem to develop proper code to have outlook print attachments to all "conditional" files automatically. The Attachment Collection does not refer to any attached documents; it refers to the items within the email (CC, BCC, Subject, etc.). It lets me Add an attachment with code, but I can't print an existing one (go figure)? So, what do I do? dd To manipulate an attachment in the Attachments collection you would have to save it to the file system and work with it from there. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginners G...

Automation from an MFC Regular DLL
Hello MVPs, I want to automate MS Excel from an MFC app, and I have followed the AutoProject instruction listed in the MSDN documention. http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/KB/Articles/Q192/3/48.asp&NoWebContent=1 However instead of using VC++6.0 i am using Visual Studio .NET to create the MFC App AutoProject. This works a little different from VC++6.0. When I try to add the Class using a Type Library, in .NET I can use the Add Class From TypeLib Wizard which is a Dialog that allows me to select all the Available type libraries liste...

Excel Template modification using automation
I am using automation (from vb6 project) to open an excel template (test.xlt). I want to modify some cell values and then resave the template. I keep encountering a File Readonly error. Could someone post some sample code that would allow me to programmatically modify an excel template and then save template, overwriting old template tai Terry Holland I think you may get various responses based on why the file was marked readonly. If it was on a server that the user (you) only had read access, too, I think you're out of luck. If it was marked Readonly (via windows explorer's ...

Automation
Hi, Please i need a way around this stuff quickly. I deal with large excel files and usually have to comapare an electronic copy (current) and a hard copy (downloaded from a server a week earlier) and make some remarks on the new one. I could actually lay my hands on the electronic copy of the older list. The prob now is that how do i automate the process and let the program (excel or any other u might suggest) note the missing rows (numbers) in the newer and give a PASS remark on the newer one? I have tried all the tricks i know about writing/ recording excel macros and vba to no avail. P...

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, ...