A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Outlook » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Automate From Field



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2010, 09:31 AM posted to microsoft.public.outlook.general
Sue[_9_]
external usenet poster
 
Posts: 65
Default Automate From Field

Hi all

I posted this last week but it seems MS deleted a load of its forums,
including the VBA one I'd posted to :-(. So here goes again...

From MS Access 2003, I have a routine in code that automates an email. 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 and 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
leave for the user to enter the from email address manually it is very easy
for them to miss this and just hit send, which 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...

snipped of the Code, if I rem the .from line this will work ok...

With objEmail
.from "
.To = "SJH-" & dist
.CC = "
.BCC = "sue;fred;tom"
.Subject = "Analysis Monthly Reports"
.Body = "Test email please ignore... "
.Attachments.Add strPath


  #2  
Old June 7th, 2010, 10:35 AM posted to microsoft.public.outlook.general
Sue[_9_]
external usenet poster
 
Posts: 65
Default Automate From Field

Hi just in case you spot the missing '=' sign this doesn't work still...

"Sue" wrote in message
...
Hi all

I posted this last week but it seems MS deleted a load of its forums,
including the VBA one I'd posted to :-(. So here goes again...

From MS Access 2003, I have a routine in code that automates an email. 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 and 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 leave for the user to enter the from email address manually it is very
easy for them to miss this and just hit send, which 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...

snipped of the Code, if I rem the .from line this will work ok...

With objEmail
.from "
.To = "SJH-" & dist
.CC = "
.BCC = "sue;fred;tom"
.Subject = "Analysis Monthly Reports"
.Body = "Test email please ignore... "
.Attachments.Add strPath



  #3  
Old June 7th, 2010, 12:57 PM posted to microsoft.public.outlook.general
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 232
Default Automate From Field

In the future, you can use the Outlook for Developers forum at
http://social.msdn.microsoft.com/For...ookdev/threads for your
Outlook coding questions.

The object browser (F2 in VBA) is your friend: If you used it to look at the
MailItem object in the Outlook object model, you'd see that there is no From
property. That's the cause of your error.

You didn't say what version of Outlook you're using, but I presume it's
Outlook 2003. That version provides no direct way to change the sender for
an outgoing message. These are known workarounds using native Outlook
functionality:

1) If the user has Outlook 2002/3 and is not using WordMail as the editor,
you set the sending account using CommandBars techniques. See
http://www.outlookcode.com/codedetail.aspx?id=889 for sample code.

2) In an Exchange environment where you want to use another user's mailbox
as the From address, set the MailItem.SentOnBehalfOfName property. If you do
not want the current user's name to appear in the message at all, the
Exchange administrator must grant Send As permission on the other user's
mailbox.

Note that you can use SentOnBehalfOfName in non-Exchange scenarios, too, but
the results may not be what you expect. Test for yourself before implementing
on a large scale.

3) If you're mainly concerned about replies to your message going to the
correct place, add the desired reply address to the MailItem.ReplyRecipients
collection.

The third-party Redemption ( http://www.dimastr.com/redemption/ ) library
adds two other solutions:

4) Set an RFC822 header property, as described at
http://www.dimastr.com/redemption/faq.htm#14

5) Set the RDOMail.Account property, as described at
http://www.dimastr.com/redemption/rdo/RDOMail.htm
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"Sue" wrote:

Hi just in case you spot the missing '=' sign this doesn't work still...

"Sue" wrote in message
...
Hi all

I posted this last week but it seems MS deleted a load of its forums,
including the VBA one I'd posted to :-(. So here goes again...

From MS Access 2003, I have a routine in code that automates an email. 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 and 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 leave for the user to enter the from email address manually it is very
easy for them to miss this and just hit send, which 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...

snipped of the Code, if I rem the .from line this will work ok...

With objEmail
.from "
.To = "SJH-" & dist
.CC = "
.BCC = "sue;fred;tom"
.Subject = "Analysis Monthly Reports"
.Body = "Test email please ignore... "
.Attachments.Add strPath



.

  #4  
Old June 7th, 2010, 03:01 PM posted to microsoft.public.outlook.general
Sue[_9_]
external usenet poster
 
Posts: 65
Default Automate From Field

Thanks I will use the other forum from now on...

Yes it is Outlook 2003 and we do use an Exchange Server. The other email
address is a public folder though so not strictly a 'mailbox' - not sure if
this changes things? It all works as desired manually, I have set the
relevant send as permissions etc for those who need to send these messages
and the replies are returned back to the public folder and copied to another
mailbox.

I'd assumed there was no '.From' command when it failed, I just didn't know
if there was a way round this. I will have a look at the command bar
techniques you mentioned thanks, if all else fails the user will just have
to enter the From field manually...



"Sue Mosher [MVP]" wrote in message
...
In the future, you can use the Outlook for Developers forum at
http://social.msdn.microsoft.com/For...ookdev/threads for your
Outlook coding questions.

The object browser (F2 in VBA) is your friend: If you used it to look at
the
MailItem object in the Outlook object model, you'd see that there is no
From
property. That's the cause of your error.

You didn't say what version of Outlook you're using, but I presume it's
Outlook 2003. That version provides no direct way to change the sender
for
an outgoing message. These are known workarounds using native Outlook
functionality:

1) If the user has Outlook 2002/3 and is not using WordMail as the editor,
you set the sending account using CommandBars techniques. See
http://www.outlookcode.com/codedetail.aspx?id=889 for sample code.

2) In an Exchange environment where you want to use another user's mailbox
as the From address, set the MailItem.SentOnBehalfOfName property. If you
do
not want the current user's name to appear in the message at all, the
Exchange administrator must grant Send As permission on the other user's
mailbox.

Note that you can use SentOnBehalfOfName in non-Exchange scenarios, too,
but
the results may not be what you expect. Test for yourself before
implementing
on a large scale.

3) If you're mainly concerned about replies to your message going to the
correct place, add the desired reply address to the
MailItem.ReplyRecipients
collection.

The third-party Redemption ( http://www.dimastr.com/redemption/ ) library
adds two other solutions:

4) Set an RFC822 header property, as described at
http://www.dimastr.com/redemption/faq.htm#14

5) Set the RDOMail.Account property, as described at
http://www.dimastr.com/redemption/rdo/RDOMail.htm
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"Sue" wrote:

Hi just in case you spot the missing '=' sign this doesn't work still...

"Sue" wrote in message
...
Hi all

I posted this last week but it seems MS deleted a load of its forums,
including the VBA one I'd posted to :-(. So here goes again...

From MS Access 2003, I have a routine in code that automates an email.
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 and 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 leave for the user to enter the from email address manually it is
very
easy for them to miss this and just hit send, which 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...

snipped of the Code, if I rem the .from line this will work ok...

With objEmail
.from "
.To = "SJH-" & dist
.CC = "
.BCC = "sue;fred;tom"
.Subject = "Analysis Monthly Reports"
.Body = "Test email please ignore... "
.Attachments.Add strPath



.



 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.