PC Review

Thread Tools Rate Thread

Outlook macro - SendUsingAccount - settings error or bug?

Posts: n/a
      23rd Mar 2011

I am using Outlook 2010, and have two mailboxes, individual mailbox A
(Angela) and group mailbox B (Bank Department),

When I open a mail from Mailbox A, and run macro ReplyAll() below, the
FROM field of the email will be changed from Angela to Bank Department
correctly, and displaying the following results:
http://www.pcreview.co.uk/forums/(E-Mail Removed) - Angela
Angela - Bank Department
(E-Mail Removed) - Bank Department

However, when I open a mail from group Mailbox B, and run macro
ReplyAll() below, the FROM field will remain unchanged as Bank
Department, even though the following results are displayed correctly:
(E-Mail Removed) - Bank Department
Bank Department - Angela
(E-Mail Removed) - Angela

Is it because of the group mailbox settings? Or is there a bug? I have
tried many different methods but still, the FROM field is not changed
on the second case. I have even tried to programmatically copy the
email from B to A and ReplyAll() from A, it still remain unchanged as
Bank Department. Please advise.

Public Sub ReplyAll()

Dim oAccount As Outlook.Account
Dim oMail As Outlook.MailItem
Dim oNewMail As Outlook.MailItem
Dim oReplyMail As Outlook.MailItem

Set oMail = Application.ActiveExplorer.Selection(1)
Set oReplyMail = oMail.ReplyAll

MsgBox oReplyMail.SendUsingAccount.SmtpAddress & " - " &

For Each oAccount In Application.Session.Accounts
If oAccount <> oReplyMail.SendUsingAccount Then
MsgBox oReplyMail.SendUsingAccount & " - " & oAccount
oReplyMail.SendUsingAccount = oAccount
Exit For
End If

MsgBox oReplyMail.SendUsingAccount.SmtpAddress & " - " &

End Sub

Reply With Quote

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to send email via outlook. Sendusingaccount Boon Microsoft Access Form Coding 10 18th May 2011 08:34 AM
Outlook automation - SendUsingAccount readonly? Pavel Celba Microsoft Outlook Interoperability 6 23rd Sep 2010 05:57 PM
Access - Outlook Mail Automation: SendUsingAccount LeeTV Microsoft Access Form Coding 1 19th Apr 2010 08:04 PM
Re: Outlook SendUsingAccount to change from account Ken Slovak - [MVP - Outlook] Microsoft Outlook VBA Programming 1 8th Jun 2009 06:22 PM
Outlook 2007: SendUsingAccount - update infobar mark.terhofen@yahoo.de Microsoft Outlook VBA Programming 6 22nd Jul 2008 01:39 PM




All times are GMT +1. The time now is 06:50 AM.