Link to home
Start Free TrialLog in
Avatar of jalongoria
jalongoriaFlag for Germany

asked on

MS Outlook+Word 2010: Mail Merge from IMAP Organizational Account

I have a mail merge template as well as excel file which we're merging the data from; these function, we've tested several times with no issues.

Our problem, however, lies in the fact that the Mail Merge mechanism sends from our personal account. We work from a large Enterprise-level organization and we need to be able to send from a organizational account ( collective_us@thisplace.com as opposed to john.doe@thisplace.com ).

I've built different profiles, I've attempted to route and forward through other accounts, I've even played with delegation. In all, the efforts have failed. Has anyone else encountered this issue, and if so, what was your solution?
Avatar of Rgonzo1971
Rgonzo1971

Hi,

you could use the property sendusingaccount to adapt this code

Sub SendDocumentInMail()

Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

On Error Resume Next

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
    'Outlook wasn't running, start it from code
    Set oOutlookApp = CreateObject("Outlook.Application")
    bStarted = True
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem
    'Set the recipient for the new email
   .To = "recipient@mail.com"
    'Set the recipient for a copy
    .CC = "recipient2@mail.com"
    'Set the subject
    .Subject = "New subject"
    'The content of the document is used as the body for the email
    .Body = ActiveDocument.Content
    .Send
End With

If bStarted Then
    'If we started Outlook from code, then close it
    oOutlookApp.Quit
End If

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub

Open in new window


reference
http://msdn.microsoft.com/en-us/library/office/ff869311.aspx

Regards
Avatar of jalongoria

ASKER

Thanks for the insight! I had been looking through MSDN and came across that very function, but I couldn't figure out how to implement it because it seemed to be committed to POP3 versus IMAP. I'll try this method and see what happens!
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial