Solved

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

Posted on 2013-01-15
3
944 Views
Last Modified: 2013-02-28
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?
0
Comment
Question by:jalongoria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 38777427
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
0
 

Author Comment

by:jalongoria
ID: 38777859
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!
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 38777971
Hi,

Maybe this could help to choose the account
http://social.technet.microsoft.com/Forums/en-US/outlook/thread/f6710ef7-571d-41ed-8090-a244b96e8f2c
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'MVP OShon from VBATools.pl
If Item.Class = 43 Then
Dim objMailItem As MailItem
Set objMailItem = Item

Dim olNS As Outlook.NameSpace
Set olNS = Application.GetNamespace("MAPI")

Dim wybor$, lista$, x&
For x = 1 To olNS.Accounts.Count
 lista = lista & x & " -" & olNS.Accounts.Item(x).DisplayName & vbCr
Next x

wybor = InputBox("Select the account number from the list below:" & vbCr & lista, _
 "Broadcasting from a specific account VBATools.pl", 1)

If Len(wybor) = 0 Then Cancel = True

With objMailItem
 If IsNumeric(wybor) = True Then
 if wybor > x then goto blad
 .SendUsingAccount = olNS.Accounts.Item(wybor)
 .Save
 Else
blad:
 Cancel = True
 MsgBox "Not chosen properly account number", vbExclamation, _
 "Broadcasting from a specific account VBATools.pl"
 End If
End With

Set objMailItem = Nothing
Set olNS = Nothing
End If
End Sub

Open in new window


Regards
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question