Hi All,
First post to the forum and i would really appreciate some help with this issue.
My company has recently migrated be from Outlook 2010 to Outlook 2016. In 2010, i had a macro embedded in the Application_ItemSend event that changed the value of the 'From' field automatically from whatever it was set to, to my personal account.
To do this, I used control ID 31224 and modified the 'Caption' with:
Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)
oAccount = Application.Session.Accounts.item(1).UserName
Call set_account(item,oAccount)
End Sub
Function Set_Account(M,AccountName)
Set OLI = M.GetInspector
Set CBs = OLI.CommandBars
Set CBP = CBs.FindControl(, 31224)
For Each MC In CBP.Controls
intLoc = InStr(MC.Caption, " ") strAccountBtnName = MC.Caption
If strAccountBtnName <> AccountName Then
MC.Execute
Set_Account = AccountName
GoTo Exit_Function
End If
Next
Exit_Function:
End Function
However, Office 2016 doesn't seem to have Control ID 31224. Any idea how I can change the account I am sending the email 'From' using a VBA macro in Outlook 2016?
I have checked through all the CommandBars and I cant find an alternative option.