Paul Alford
New Member
- Joined
- Sep 21, 2009
- Messages
- 18
Hi,
I am getting a VBA type mismatch error in Excel 2007 with the following code at the line .SendUsingAccount and I can't seem to find a solution to the problem. It's driving me nuts. Without this line emails are created and sent perfectly from the default mail account in Outlook 2007, but when I add the line of code to select a different account it keels over.
Below is the code.
Can anyone point me in the right direction please?
I am getting a VBA type mismatch error in Excel 2007 with the following code at the line .SendUsingAccount and I can't seem to find a solution to the problem. It's driving me nuts. Without this line emails are created and sent perfectly from the default mail account in Outlook 2007, but when I add the line of code to select a different account it keels over.
Below is the code.
Can anyone point me in the right direction please?
Code:
Dim AccountToSendFrom As String
AccountToSendFrom = "john.doe@acme.com"
With MItem
.To = IntEmail
.Subject = Msg2
.Body = Msg
.SendUsingAccount = AccountToSendFrom
End With