I use this code to set up toolbar buttons for quickly forwarding mail to others. It works great.
I need to add to the code so that I can forward the mail from a "specific" email account, rather than the default. I've researched this and I think I need to add a line like
.SenderName = "email@example.com"
But that does not seem to work; resulting in an error message.
How can I set the account from which to forward the emails?
Dim item As Object
Dim itmFwd As Object
Dim recipMe As Recipient
On Error Resume Next
If TypeName(Application.ActiveWindow) = "Explorer" Then
Set item = ActiveExplorer.Selection(1)
Set item = ActiveInspector.CurrentItem
On Error GoTo 0
If Not item Is Nothing Then
Set itmFwd = item.Forward
Set recipMe = .Recipients.Add("firstname.lastname@example.org")
<font color=red> ' The following line was added, but does not work as I thought it would
.SenderName = "email@example.com"</font color=red>
MsgBox "Nothing selected"
Set item = Nothing