I use this code to set up toolbar buttons for quickly forwarding mail to others. It works great.
But...
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 = "tricky@gmail.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?
<pre>Sub Fwd_To_Home()
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)
Else
Set item = ActiveInspector.CurrentItem
End If
On Error GoTo 0
If Not item Is Nothing Then
Set itmFwd = item.Forward
With itmFwd
Set recipMe = .Recipients.Add("home@gmail.com")
recipMe.Resolve
.Save
<font color=red> ' The following line was added, but does not work as I thought it would
.SenderName = "tricky@gmail.com"</font color=red>
.Send
End With
Else
MsgBox "Nothing selected"
End If
Set item = Nothing
End Sub</pre>



