Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Outlook macro - SendUsingAccount - settings error or bug?

39 views
Skip to first unread message

vic

unread,
Mar 23, 2011, 8:35:43 AM3/23/11
to
Hi,

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:
ang...@hsb.com - Angela
Angela - Bank Department
ba...@hsb.com - 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:
ba...@hsb.com - Bank Department
Bank Department - Angela
ang...@hsb.com - 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
oReplyMail.Display

MsgBox oReplyMail.SendUsingAccount.SmtpAddress & " - " &
oReplyMail.SendUsingAccount.DisplayName

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

MsgBox oReplyMail.SendUsingAccount.SmtpAddress & " - " &
oReplyMail.SendUsingAccount.DisplayName

End Sub

Thanks,
Vic

0 new messages