new to business contact manager

G

Guest

That is not what I want to do. I have almost 100 projects for which
individual project reporst have to be sent to the clients and their
contractors. I want to be able to email all the business contacts within an
account. For these purposes, the account will represent the project and the
business contacts within the account will represent the client and their
contractors.

Please, please try again to send some help.

Louise
 
G

Guest

The only way, beside creating distribution lists manually, is to view your
buisness contacts by account. Select the business contacts to be email and
then run an email merge from the Tool menu.

There isn't a function to send an email from the Account contact card to all
business contacts. The only way to do it would be to launch and email and add
them individually to the email To: or CC: fields. Or, you could create
distribution lists.
 
G

Guest

I have to say that I am greatly disappointed! Especially after spending $500!
I found a way around it that will work in most cases. I will use the email
addresses allowed (up to 3) for the account. This will do for now.

Thanks for your input.
Louise
 
G

Guest

Guy,

This email merge application is pathetic. If it weren't for some other
features of Outlook, I'd go back to my $60 Contact manager that easily did
email merge without all the crap MS dishes out.

With the other CM, I can select, sort, categorize, contacts anyway I want to
then email merge. It's so typical with MS- every task is a major league
chore.
 
M

mrtimpeterson via OfficeKB.com

EcoLouise,

I don't expect that you are prepared to really dump your BCM over this but
FYI, there is a very nice alternative to BCM that easily does a very simple
job of what you are trying to do. Go to www.avidian.com. The Prophet
application comes with a very powerful and easy to use group email wizard
that does NOT require any of the involved Word mail merge procedure.

-THP
 
C

Clinton Ford [MSFT]

Below is an improved version of the Outlook BCM Email and Letter macros that will send to all Business Contacts linked to the
selected Account(s), Opportunity(s), or Business Project(s). Hold the CTRL key while left-clicking on items in the outlook Outlook
view. Then click one of the macro buttons to open a Marketing Campaign ready to mail merge with all related contacts.

Be sure to modify the e-mail and letter tempalte file paths given near the top of the macro code.

Enjoy!

To create these buttons on your Outlook toolbar:
1.) Verify that your security settings will prompt you to run unsigned macros by selecting "Tools | Trust Center..." from the main
Outlook window.
Then click "Macro Security" and select "Warnings for all macros" and click "OK"
2.) Create a Macro from the main Outlook window by selecting "Tools | Macro | Macros..."
3.) Type "Email" as the Macro Name, then click "Create"
4.) The Visual Basic editing window will open. On the left-hand side is a project navigation pane.
Right-click on the top-level item named "Project1" and select "Project1 Properties..."
5.) Change "Project1" to "Business" and click "OK"
6.) In the main code area, you'll see "Sub Email()", followed by "End Sub".
Replace those two lines with the VBA code below, then click Save.
7.) Close the Visual Basic window to return to Outlook
8.) Right-click on the Outlook toolbar and click "Customize..."
9.) Select the "Commands" tab, select the "Macro" from the Categories list, then drag "Business.Letter" and "Business.Email" to the
standard Outlook toolbar and click "Close" on the "Customize" dialog.
10.) Select a business contact or account, then click the "Business.Email" button.


'//////////////////////////////////////////////////////////////////////////
' Create a New Business E-mail for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Email()
' E-MAIL TEMPLATE: If you use an e-mail template, enter its path here
Const emailFilePath = "C:\E-mail Thank You.docx"
OpenCampaign True, emailFilePath
End Sub

' Create a New Business Letter for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Letter()
' LETTER TEMPLATE: If you use a letter template, enter its path here
Const letterFilePath = "C:\Thank You.docx"
OpenCampaign False, letterFilePath
End Sub

' Open a new Marketing Campaign with the appropriate settings
Sub OpenCampaign(Email As Boolean, contentFilePath As String)

' Get a reference to the MAPI namespace
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")

' Make sure at least one item is selected
If Application.ActiveExplorer Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If
If Application.ActiveExplorer.selection Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected item
Dim oItem As Object
Set oItem = Application.ActiveExplorer.selection(1)
If oItem Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected Outlook folder
Dim currentFolder As Outlook.Folder
Set currentFolder = Application.ActiveExplorer.currentFolder
If currentFolder Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Verify that this folder is located in the Business Contact
' Manager Outlook Store
If 1 <> InStr(1, currentFolder.FullFolderPath, _
"\\Business Contact Manager\", vbTextCompare) Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Get the root BCM folder
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Set olFolders = objNS.Session.Folders
If olFolders Is Nothing Then
MsgBox "Unable to get the list of Outlook Session folders"
Exit Sub
End If
Set bcmRootFolder = olFolders("Business Contact Manager")

' Get an XML recipient list
Dim strRecipientXML As String
strRecipientXML = _
GetRecipientXML(objNS, _
Application.ActiveExplorer.selection, _
bcmRootFolder)
If Trim(strRecipientXML) = "" Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Locate the Marketing Campaigns folder
Dim marketingCampaignFolder As Outlook.Folder
Set marketingCampaignFolder = _
bcmRootFolder.Folders("Marketing Campaigns")

' Create a new Marketing Campaign
Const MarketingCampaignMessageClass = "IPM.Task.BCM.Campaign"
Dim newMarketingCampaign As Outlook.TaskItem
Set newMarketingCampaign = _
marketingCampaignFolder.Items.Add(MarketingCampaignMessageClass)

' Campaign Code
Dim campaignCode As Outlook.userProperty
Set campaignCode = newMarketingCampaign.ItemProperties("Campaign Code")
If campaignCode Is Nothing Then
Set campaignCode = _
newMarketingCampaign.ItemProperties.Add("Campaign Code", _
olText, False, False)
End If
campaignCode.value = CStr(Now())

' Campaign Type
Dim campaignType As Outlook.userProperty
Set campaignType = _
newMarketingCampaign.ItemProperties("Campaign Type")
If campaignType Is Nothing Then
Set campaignType = _
newMarketingCampaign.ItemProperties.Add("Campaign Type", _
olText, False, False)
End If

' Delivery Method
Dim deliveryMethod As Outlook.userProperty
Set deliveryMethod = _
newMarketingCampaign.ItemProperties("Delivery Method")
If deliveryMethod Is Nothing Then
Set deliveryMethod = _
newMarketingCampaign.ItemProperties.Add("Delivery Method", _
olText, False, False)
End If

' See if this is an e-mail or print letter
Dim title As String
If Email Then
title = "E-mail to "
campaignType.value = "E-mail"
deliveryMethod.value = "Word E-Mail Merge"
Else
title = "Letter to "
campaignType.value = "Direct Mail Print"
deliveryMethod.value = "Word Mail Merge"
End If

' Marketing Campaign Title
Select Case oItem.MessageClass
Case "IPM.Contact.BCM.Contact":
title = title & oItem.FullName
Case "IPM.Contact.BCM.Account":
title = title & oItem.FullName
Case "IPM.Task.BCM.Opportunity":
title = title & oItem.subject
Case "IPM.Task.BCM.Project"
title = title & oItem.subject
End Select

newMarketingCampaign.subject = title

' Content File
Dim contentFile As Outlook.userProperty
Set contentFile = newMarketingCampaign.ItemProperties("Content File")
If contentFile Is Nothing Then
Set contentFile = _
newMarketingCampaign.ItemProperties.Add("Content File", _
olText, False, False)
End If
contentFile.value = contentFilePath

' FormQuerySelection
Dim formQuerySelection As Outlook.userProperty
Set formQuerySelection = _
newMarketingCampaign.ItemProperties("FormQuerySelection")
If formQuerySelection Is Nothing Then
Set formQuerySelection = _
newMarketingCampaign.ItemProperties.Add("FormQuerySelection", _
olInteger, False, False)
End If
formQuerySelection.value = 9 ' Custom Query

' Recipient List XML
Dim recipientListXML As Outlook.userProperty
Set recipientListXML = _
newMarketingCampaign.ItemProperties("Recipient List XML")
If recipientListXML Is Nothing Then
Set recipientListXML = _
newMarketingCampaign.ItemProperties.Add("Recipient List XML", _
olText, False, False)
End If

' Set the Recipient List XML
recipientListXML.value = strRecipientXML

' Save the marketing campaign
newMarketingCampaign.Save

' Launch the new marketing campaign
newMarketingCampaign.Display (False)

Set recipientListXML = Nothing
Set formQuerySelection = Nothing
Set deliveryMethod = Nothing
Set contentFile = Nothing
Set campaignType = Nothing
Set campaignCode = Nothing
Set newMarketingCampaign = Nothing
Set marketingCampaignFolder = Nothing
Set bcmRootFolder = Nothing
Set olFolders = Nothing
Set oItem = Nothing
Set currentFolder = Nothing
Set objNS = Nothing
End Sub

' Returns an XML string that specifies the recipients
Function GetRecipientXML(objNS As Outlook.NameSpace, _
selectionList As Outlook.selection, _
bcmRootFolder As Outlook.Folder) As String
' Initialize the retun value to empty string
GetRecipientXML = ""
' Make sure we have a valid parameters
If objNS Is Nothing Or _
selectionList Is Nothing Or _
bcmRootFolder Is Nothing Then
Exit Function
End If

' Build the recipient XML
Dim strRecipientXML
strRecipientXML = "<ArrayOfCampaignRecipient>"

' Add all selected items to the recipient list
Dim oItem As Object
Dim astrContactEntryIDs() As String
ReDim Preserve astrContactEntryIDs(0)
Dim contactEntryId As Variant
Dim oParentEntryID As Object
Dim oParent As Object

For Each oItem In selectionList
If oItem Is Nothing Then
MsgBox "Warning: Item not found"
Else
' Only get the EntryID if this is a Business Contact, Account,
' Opportunity, or Business Project
Select Case oItem.MessageClass
' Business Contact
Case "IPM.Contact.BCM.Contact":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Account
Case "IPM.Contact.BCM.Account":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Add Business Contacts associated with this Account
GetContactEnryIdsFromAccount bcmRootFolder, _
oItem.EntryID, _
astrContactEntryIDs
' Opportunity
Case "IPM.Task.BCM.Opportunity":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This opportunity is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
' If parent is Account, get account's contacts, too
On Error Resume Next
Set oParent = _
objNS.GetItemFromID(oParentEntryID.value)
If Err.Number = 0 Then
If Not (oParent Is Nothing) And _
oParent.MessageClass = _
"IPM.Contact.BCM.Account" Then
GetContactEnryIdsFromAccount _
bcmRootFolder, _
oParentEntryID.value, _
astrContactEntryIDs
End If
End If
On Error GoTo 0
End If
' Business Project
Case "IPM.Task.BCM.Project":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This project is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
GetContactEntryIDsFromProject oItem, _
astrContactEntryIDs
End If
Case Else:
' Invalid BCM type
Exit Function
End Select
End If
Next ' Add selected items

' Add recipients
If astrContactEntryIDs(0) <> "" Then
For Each contactEntryId In astrContactEntryIDs
If contactEntryId = "" Then
MsgBox "Warning: Contact not found"
Else
strRecipientXML = strRecipientXML & _
" <CampaignRecipient>" & _
" <EntryID>" & contactEntryId & "</EntryID>" & _
" </CampaignRecipient>"
End If
Next
End If

' Close the recipient list
strRecipientXML = strRecipientXML & "</ArrayOfCampaignRecipient>"

' Example XML for an external list of leads
Dim strExternalRecipientXML
strExternalRecipientXML = _
"<ArrayOfCampaignRecipient>" & _
" <CampaignRecipient>" & _
" <FileAs>Ashton, Chris</FileAs>" & _
" <EmailAddress>[email protected]</EmailAddress>" & _
" </CampaignRecipient>" & _
"</ArrayOfCampaignRecipient>"

Set oParent = Nothing
Set oParentEntryID = Nothing
Set oItem = Nothing

' Return the Recipient List XML
GetRecipientXML = strRecipientXML
End Function

' Returns an array of Business Contact EntryID's for the given Account
Sub GetContactEnryIdsFromAccount(bcmRootFolder As Outlook.Folder, _
strAccountID As String, _
astrContactIDs() As String)
' Check for a valid BCM root folder and Account EntryID
If bcmRootFolder Is Nothing Or Trim(strAccountID) = "" Then
Exit Sub
End If

' Locate the Business Contacts folder
Dim businessContacts As Outlook.Folder
Set businessContacts = _
bcmRootFolder.Folders("Business Contacts")
If businessContacts Is Nothing Or _
businessContacts.Items Is Nothing Then
Exit Sub
End If

' Setup the filter restriction string
Dim strRestriction As String
strRestriction = "[Parent Entity EntryID] = '" & strAccountID & "'"
Dim accountContacts As Outlook.Items
Set accountContacts = businessContacts.Items.Restrict(strRestriction)
If accountContacts Is Nothing Then
Exit Sub
End If

' Add each contact to the list of Account contacts
Dim oContact As Object
Dim i As Integer
For Each oContact In accountContacts
If oContact Is Nothing Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, oContact.EntryID
End If
Next
Set accountContacts = Nothing
Set businessContacts = Nothing
End Sub

' Get EntryID's for Project's related Business Contacts and Accounts
Sub GetContactEntryIDsFromProject(oProject As Outlook.TaskItem, _
astrContactIDs() As String)
If oProject Is Nothing Then
Exit Sub
End If
Dim associatedContacts As Outlook.userProperty
Set associatedContacts = _
oProject.UserProperties("Associated Contacts")
If (associatedContacts Is Nothing) Then
Exit Sub
End If
projectContacts = associatedContacts.value
Dim projectContact As Variant
Dim i As Integer
On Error Resume Next
For Each projectContact In projectContacts
If IsObject(projectContact) Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, CStr(projectContact)
End If
Next
On Error GoTo 0
Set associatedContacts = Nothing
End Sub

' Add a unique campaign recipient to the given array
Sub AddCampaignRecipient(ByRef astrRecipientIDs() As String, _
recipientID As String)
Dim arrFilter() As String
' Check to see if this is a duplicate recipient
arrFilter = Filter(astrRecipientIDs, recipientID, True, vbTextCompare)
If UBound(arrFilter) < 0 Then
Dim i As Integer
i = UBound(astrRecipientIDs)
' See if we need to grow the array length
If i > 0 Or astrRecipientIDs(0) <> "" Then
i = i + 1
ReDim Preserve astrRecipientIDs(0 To i)
End If
' Add this recipient to our list
astrRecipientIDs(i) = recipientID
End If
End Sub
'//////////////////////////////////////////////////////////////////////////
 
G

Guest

I want to use MS BCM in precisely the way EcoLouise describes. It seems to me
inexplicable that it is not possible to create a list of accounts and then
send email to all linked contacts of each account.

Hopefully a technical friend can do something with the Macro, detailed later
 
G

Guest

Dave -- I haven't tried or studied the macro, but the description of it
sounds like it does what you are looking for. What does it need to do that
it is not doing?

Regards.....Bill Kratz
 
A

Asp Mkt

It shouldn't create a new marketing campaign. All it should do is take the contact info and the minute you click on the button, it should open the word document, do a mail merge of either the one contact or all the contacts selected and finish the merge opening the letters to be edited.

The fact that it opens the marketing campaign is this issue. At that point, do a mail merge is easier. The reason is this. I have sales reps that have been with the company for years. They want things to be easy...ie a button that says "Generate Quote Letter" and voila, the quote letter template is opened that the contact they were in contact info dumped in.

Thanks for any help, I'm working on the coding to see if I can fix it, but I still can't get around the new campaign thingy.



whkrat wrote:

Dave -- I haven't tried or studied the macro, but the description of it sounds
02-May-07

Dave -- I haven't tried or studied the macro, but the description of it
sounds like it does what you are looking for. What does it need to do that
it is not doing?

Regards.....Bill Kratz

:

Previous Posts In This Thread:

Guy,This email merge application is pathetic.
Guy,

This email merge application is pathetic. If it weren't for some other
features of Outlook, I'd go back to my $60 Contact manager that easily did
email merge without all the crap MS dishes out.

With the other CM, I can select, sort, categorize, contacts anyway I want to
then email merge. It's so typical with MS- every task is a major league
chore.



:

EcoLouise,I don't expect that you are prepared to really dump your BCM over
EcoLouise,

I don't expect that you are prepared to really dump your BCM over this but
FYI, there is a very nice alternative to BCM that easily does a very simple
job of what you are trying to do. Go to www.avidian.com. The Prophet
application comes with a very powerful and easy to use group email wizard
that does NOT require any of the involved Word mail merge procedure.

-THP

Bob Heiney wrote:

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/outlook-bcm/200703/1

Below is an improved version of the Outlook BCM Email and Letter macros that
Below is an improved version of the Outlook BCM Email and Letter macros that will send to all Business Contacts linked to the
selected Account(s), Opportunity(s), or Business Project(s). Hold the CTRL key while left-clicking on items in the outlook Outlook
view. Then click one of the macro buttons to open a Marketing Campaign ready to mail merge with all related contacts.

Be sure to modify the e-mail and letter tempalte file paths given near the top of the macro code.

Enjoy!

To create these buttons on your Outlook toolbar:
1.) Verify that your security settings will prompt you to run unsigned macros by selecting "Tools | Trust Center..." from the main
Outlook window.
Then click "Macro Security" and select "Warnings for all macros" and click "OK"
2.) Create a Macro from the main Outlook window by selecting "Tools | Macro | Macros..."
3.) Type "Email" as the Macro Name, then click "Create"
4.) The Visual Basic editing window will open. On the left-hand side is a project navigation pane.
Right-click on the top-level item named "Project1" and select "Project1 Properties..."
5.) Change "Project1" to "Business" and click "OK"
6.) In the main code area, you'll see "Sub Email()", followed by "End Sub".
Replace those two lines with the VBA code below, then click Save.
7.) Close the Visual Basic window to return to Outlook
8.) Right-click on the Outlook toolbar and click "Customize..."
9.) Select the "Commands" tab, select the "Macro" from the Categories list, then drag "Business.Letter" and "Business.Email" to the
standard Outlook toolbar and click "Close" on the "Customize" dialog.
10.) Select a business contact or account, then click the "Business.Email" button.


'//////////////////////////////////////////////////////////////////////////
' Create a New Business E-mail for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Email()
' E-MAIL TEMPLATE: If you use an e-mail template, enter its path here
Const emailFilePath = "C:\E-mail Thank You.docx"
OpenCampaign True, emailFilePath
End Sub

' Create a New Business Letter for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Letter()
' LETTER TEMPLATE: If you use a letter template, enter its path here
Const letterFilePath = "C:\Thank You.docx"
OpenCampaign False, letterFilePath
End Sub

' Open a new Marketing Campaign with the appropriate settings
Sub OpenCampaign(Email As Boolean, contentFilePath As String)

' Get a reference to the MAPI namespace
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")

' Make sure at least one item is selected
If Application.ActiveExplorer Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If
If Application.ActiveExplorer.selection Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected item
Dim oItem As Object
Set oItem = Application.ActiveExplorer.selection(1)
If oItem Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected Outlook folder
Dim currentFolder As Outlook.Folder
Set currentFolder = Application.ActiveExplorer.currentFolder
If currentFolder Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Verify that this folder is located in the Business Contact
' Manager Outlook Store
If 1 <> InStr(1, currentFolder.FullFolderPath, _
"\\Business Contact Manager\", vbTextCompare) Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Get the root BCM folder
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Set olFolders = objNS.Session.Folders
If olFolders Is Nothing Then
MsgBox "Unable to get the list of Outlook Session folders"
Exit Sub
End If
Set bcmRootFolder = olFolders("Business Contact Manager")

' Get an XML recipient list
Dim strRecipientXML As String
strRecipientXML = _
GetRecipientXML(objNS, _
Application.ActiveExplorer.selection, _
bcmRootFolder)
If Trim(strRecipientXML) = "" Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Locate the Marketing Campaigns folder
Dim marketingCampaignFolder As Outlook.Folder
Set marketingCampaignFolder = _
bcmRootFolder.Folders("Marketing Campaigns")

' Create a new Marketing Campaign
Const MarketingCampaignMessageClass = "IPM.Task.BCM.Campaign"
Dim newMarketingCampaign As Outlook.TaskItem
Set newMarketingCampaign = _
marketingCampaignFolder.Items.Add(MarketingCampaignMessageClass)

' Campaign Code
Dim campaignCode As Outlook.userProperty
Set campaignCode = newMarketingCampaign.ItemProperties("Campaign Code")
If campaignCode Is Nothing Then
Set campaignCode = _
newMarketingCampaign.ItemProperties.Add("Campaign Code", _
olText, False, False)
End If
campaignCode.value = CStr(Now())

' Campaign Type
Dim campaignType As Outlook.userProperty
Set campaignType = _
newMarketingCampaign.ItemProperties("Campaign Type")
If campaignType Is Nothing Then
Set campaignType = _
newMarketingCampaign.ItemProperties.Add("Campaign Type", _
olText, False, False)
End If

' Delivery Method
Dim deliveryMethod As Outlook.userProperty
Set deliveryMethod = _
newMarketingCampaign.ItemProperties("Delivery Method")
If deliveryMethod Is Nothing Then
Set deliveryMethod = _
newMarketingCampaign.ItemProperties.Add("Delivery Method", _
olText, False, False)
End If

' See if this is an e-mail or print letter
Dim title As String
If Email Then
title = "E-mail to "
campaignType.value = "E-mail"
deliveryMethod.value = "Word E-Mail Merge"
Else
title = "Letter to "
campaignType.value = "Direct Mail Print"
deliveryMethod.value = "Word Mail Merge"
End If

' Marketing Campaign Title
Select Case oItem.MessageClass
Case "IPM.Contact.BCM.Contact":
title = title & oItem.FullName
Case "IPM.Contact.BCM.Account":
title = title & oItem.FullName
Case "IPM.Task.BCM.Opportunity":
title = title & oItem.subject
Case "IPM.Task.BCM.Project"
title = title & oItem.subject
End Select

newMarketingCampaign.subject = title

' Content File
Dim contentFile As Outlook.userProperty
Set contentFile = newMarketingCampaign.ItemProperties("Content File")
If contentFile Is Nothing Then
Set contentFile = _
newMarketingCampaign.ItemProperties.Add("Content File", _
olText, False, False)
End If
contentFile.value = contentFilePath

' FormQuerySelection
Dim formQuerySelection As Outlook.userProperty
Set formQuerySelection = _
newMarketingCampaign.ItemProperties("FormQuerySelection")
If formQuerySelection Is Nothing Then
Set formQuerySelection = _
newMarketingCampaign.ItemProperties.Add("FormQuerySelection", _
olInteger, False, False)
End If
formQuerySelection.value = 9 ' Custom Query

' Recipient List XML
Dim recipientListXML As Outlook.userProperty
Set recipientListXML = _
newMarketingCampaign.ItemProperties("Recipient List XML")
If recipientListXML Is Nothing Then
Set recipientListXML = _
newMarketingCampaign.ItemProperties.Add("Recipient List XML", _
olText, False, False)
End If

' Set the Recipient List XML
recipientListXML.value = strRecipientXML

' Save the marketing campaign
newMarketingCampaign.Save

' Launch the new marketing campaign
newMarketingCampaign.Display (False)

Set recipientListXML = Nothing
Set formQuerySelection = Nothing
Set deliveryMethod = Nothing
Set contentFile = Nothing
Set campaignType = Nothing
Set campaignCode = Nothing
Set newMarketingCampaign = Nothing
Set marketingCampaignFolder = Nothing
Set bcmRootFolder = Nothing
Set olFolders = Nothing
Set oItem = Nothing
Set currentFolder = Nothing
Set objNS = Nothing
End Sub

' Returns an XML string that specifies the recipients
Function GetRecipientXML(objNS As Outlook.NameSpace, _
selectionList As Outlook.selection, _
bcmRootFolder As Outlook.Folder) As String
' Initialize the retun value to empty string
GetRecipientXML = ""
' Make sure we have a valid parameters
If objNS Is Nothing Or _
selectionList Is Nothing Or _
bcmRootFolder Is Nothing Then
Exit Function
End If

' Build the recipient XML
Dim strRecipientXML
strRecipientXML = "<ArrayOfCampaignRecipient>"

' Add all selected items to the recipient list
Dim oItem As Object
Dim astrContactEntryIDs() As String
ReDim Preserve astrContactEntryIDs(0)
Dim contactEntryId As Variant
Dim oParentEntryID As Object
Dim oParent As Object

For Each oItem In selectionList
If oItem Is Nothing Then
MsgBox "Warning: Item not found"
Else
' Only get the EntryID if this is a Business Contact, Account,
' Opportunity, or Business Project
Select Case oItem.MessageClass
' Business Contact
Case "IPM.Contact.BCM.Contact":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Account
Case "IPM.Contact.BCM.Account":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Add Business Contacts associated with this Account
GetContactEnryIdsFromAccount bcmRootFolder, _
oItem.EntryID, _
astrContactEntryIDs
' Opportunity
Case "IPM.Task.BCM.Opportunity":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This opportunity is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
' If parent is Account, get account's contacts, too
On Error Resume Next
Set oParent = _
objNS.GetItemFromID(oParentEntryID.value)
If Err.Number = 0 Then
If Not (oParent Is Nothing) And _
oParent.MessageClass = _
"IPM.Contact.BCM.Account" Then
GetContactEnryIdsFromAccount _
bcmRootFolder, _
oParentEntryID.value, _
astrContactEntryIDs
End If
End If
On Error GoTo 0
End If
' Business Project
Case "IPM.Task.BCM.Project":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This project is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
GetContactEntryIDsFromProject oItem, _
astrContactEntryIDs
End If
Case Else:
' Invalid BCM type
Exit Function
End Select
End If
Next ' Add selected items

' Add recipients
If astrContactEntryIDs(0) <> "" Then
For Each contactEntryId In astrContactEntryIDs
If contactEntryId = "" Then
MsgBox "Warning: Contact not found"
Else
strRecipientXML = strRecipientXML & _
" <CampaignRecipient>" & _
" <EntryID>" & contactEntryId & "</EntryID>" & _
" </CampaignRecipient>"
End If
Next
End If

' Close the recipient list
strRecipientXML = strRecipientXML & "</ArrayOfCampaignRecipient>"

' Example XML for an external list of leads
Dim strExternalRecipientXML
strExternalRecipientXML = _
"<ArrayOfCampaignRecipient>" & _
" <CampaignRecipient>" & _
" <FileAs>Ashton, Chris</FileAs>" & _
" <EmailAddress>[email protected]</EmailAddress>" & _
" </CampaignRecipient>" & _
"</ArrayOfCampaignRecipient>"

Set oParent = Nothing
Set oParentEntryID = Nothing
Set oItem = Nothing

' Return the Recipient List XML
GetRecipientXML = strRecipientXML
End Function

' Returns an array of Business Contact EntryID's for the given Account
Sub GetContactEnryIdsFromAccount(bcmRootFolder As Outlook.Folder, _
strAccountID As String, _
astrContactIDs() As String)
' Check for a valid BCM root folder and Account EntryID
If bcmRootFolder Is Nothing Or Trim(strAccountID) = "" Then
Exit Sub
End If

' Locate the Business Contacts folder
Dim businessContacts As Outlook.Folder
Set businessContacts = _
bcmRootFolder.Folders("Business Contacts")
If businessContacts Is Nothing Or _
businessContacts.Items Is Nothing Then
Exit Sub
End If

' Setup the filter restriction string
Dim strRestriction As String
strRestriction = "[Parent Entity EntryID] = '" & strAccountID & "'"
Dim accountContacts As Outlook.Items
Set accountContacts = businessContacts.Items.Restrict(strRestriction)
If accountContacts Is Nothing Then
Exit Sub
End If

' Add each contact to the list of Account contacts
Dim oContact As Object
Dim i As Integer
For Each oContact In accountContacts
If oContact Is Nothing Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, oContact.EntryID
End If
Next
Set accountContacts = Nothing
Set businessContacts = Nothing
End Sub

' Get EntryID's for Project's related Business Contacts and Accounts
Sub GetContactEntryIDsFromProject(oProject As Outlook.TaskItem, _
astrContactIDs() As String)
If oProject Is Nothing Then
Exit Sub
End If
Dim associatedContacts As Outlook.userProperty
Set associatedContacts = _
oProject.UserProperties("Associated Contacts")
If (associatedContacts Is Nothing) Then
Exit Sub
End If
projectContacts = associatedContacts.value
Dim projectContact As Variant
Dim i As Integer
On Error Resume Next
For Each projectContact In projectContacts
If IsObject(projectContact) Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, CStr(projectContact)
End If
Next
On Error GoTo 0
Set associatedContacts = Nothing
End Sub

' Add a unique campaign recipient to the given array
Sub AddCampaignRecipient(ByRef astrRecipientIDs() As String, _
recipientID As String)
Dim arrFilter() As String
' Check to see if this is a duplicate recipient
arrFilter = Filter(astrRecipientIDs, recipientID, True, vbTextCompare)
If UBound(arrFilter) < 0 Then
Dim i As Integer
i = UBound(astrRecipientIDs)
' See if we need to grow the array length
If i > 0 Or astrRecipientIDs(0) <> "" Then
i = i + 1
ReDim Preserve astrRecipientIDs(0 To i)
End If
' Add this recipient to our list
astrRecipientIDs(i) = recipientID
End If
End Sub
'//////////////////////////////////////////////////////////////////////////

I want to use MS BCM in precisely the way EcoLouise describes.
I want to use MS BCM in precisely the way EcoLouise describes. It seems to me
inexplicable that it is not possible to create a list of accounts and then
send email to all linked contacts of each account.

Hopefully a technical friend can do something with the Macro, detailed later
on in the thread

:

Dave -- I haven't tried or studied the macro, but the description of it sounds
Dave -- I haven't tried or studied the macro, but the description of it
sounds like it does what you are looking for. What does it need to do that
it is not doing?

Regards.....Bill Kratz

:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Build a Multi-Provider Async Methods Search Page
http://www.eggheadcafe.com/tutorial...43-988bfcbaaacc/build-a-multiprovider-as.aspx
 
A

Asp Mkt

It shouldn't create a new marketing campaign. All it should do is take the contact info and the minute you click on the button, it should open the word document, do a mail merge of either the one contact or all the contacts selected and finish the merge opening the letters to be edited.

The fact that it opens the marketing campaign is this issue. At that point, do a mail merge is easier. The reason is this. I have sales reps that have been with the company for years. They want things to be easy...ie a button that says "Generate Quote Letter" and voila, the quote letter template is opened that the contact they were in contact info dumped in.

Thanks for any help, I'm working on the coding to see if I can fix it, but I still can't get around the new campaign thingy.



whkrat wrote:

Dave -- I haven't tried or studied the macro, but the description of it sounds
02-May-07

Dave -- I haven't tried or studied the macro, but the description of it
sounds like it does what you are looking for. What does it need to do that
it is not doing?

Regards.....Bill Kratz

:

Previous Posts In This Thread:

Guy,This email merge application is pathetic.
Guy,

This email merge application is pathetic. If it weren't for some other
features of Outlook, I'd go back to my $60 Contact manager that easily did
email merge without all the crap MS dishes out.

With the other CM, I can select, sort, categorize, contacts anyway I want to
then email merge. It's so typical with MS- every task is a major league
chore.



:

EcoLouise,I don't expect that you are prepared to really dump your BCM over
EcoLouise,

I don't expect that you are prepared to really dump your BCM over this but
FYI, there is a very nice alternative to BCM that easily does a very simple
job of what you are trying to do. Go to www.avidian.com. The Prophet
application comes with a very powerful and easy to use group email wizard
that does NOT require any of the involved Word mail merge procedure.

-THP

Bob Heiney wrote:

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/outlook-bcm/200703/1

Below is an improved version of the Outlook BCM Email and Letter macros that
Below is an improved version of the Outlook BCM Email and Letter macros that will send to all Business Contacts linked to the
selected Account(s), Opportunity(s), or Business Project(s). Hold the CTRL key while left-clicking on items in the outlook Outlook
view. Then click one of the macro buttons to open a Marketing Campaign ready to mail merge with all related contacts.

Be sure to modify the e-mail and letter tempalte file paths given near the top of the macro code.

Enjoy!

To create these buttons on your Outlook toolbar:
1.) Verify that your security settings will prompt you to run unsigned macros by selecting "Tools | Trust Center..." from the main
Outlook window.
Then click "Macro Security" and select "Warnings for all macros" and click "OK"
2.) Create a Macro from the main Outlook window by selecting "Tools | Macro | Macros..."
3.) Type "Email" as the Macro Name, then click "Create"
4.) The Visual Basic editing window will open. On the left-hand side is a project navigation pane.
Right-click on the top-level item named "Project1" and select "Project1 Properties..."
5.) Change "Project1" to "Business" and click "OK"
6.) In the main code area, you'll see "Sub Email()", followed by "End Sub".
Replace those two lines with the VBA code below, then click Save.
7.) Close the Visual Basic window to return to Outlook
8.) Right-click on the Outlook toolbar and click "Customize..."
9.) Select the "Commands" tab, select the "Macro" from the Categories list, then drag "Business.Letter" and "Business.Email" to the
standard Outlook toolbar and click "Close" on the "Customize" dialog.
10.) Select a business contact or account, then click the "Business.Email" button.


'//////////////////////////////////////////////////////////////////////////
' Create a New Business E-mail for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Email()
' E-MAIL TEMPLATE: If you use an e-mail template, enter its path here
Const emailFilePath = "C:\E-mail Thank You.docx"
OpenCampaign True, emailFilePath
End Sub

' Create a New Business Letter for selected Business Contact(s) or Contacts
' linked to the selected Account(s), Opportunity(s), or Busines Project(s)
Sub Letter()
' LETTER TEMPLATE: If you use a letter template, enter its path here
Const letterFilePath = "C:\Thank You.docx"
OpenCampaign False, letterFilePath
End Sub

' Open a new Marketing Campaign with the appropriate settings
Sub OpenCampaign(Email As Boolean, contentFilePath As String)

' Get a reference to the MAPI namespace
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")

' Make sure at least one item is selected
If Application.ActiveExplorer Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If
If Application.ActiveExplorer.selection Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected item
Dim oItem As Object
Set oItem = Application.ActiveExplorer.selection(1)
If oItem Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Get a reference to the currently selected Outlook folder
Dim currentFolder As Outlook.Folder
Set currentFolder = Application.ActiveExplorer.currentFolder
If currentFolder Is Nothing Then
MsgBox "Please select at least one item"
Exit Sub
End If

' Verify that this folder is located in the Business Contact
' Manager Outlook Store
If 1 <> InStr(1, currentFolder.FullFolderPath, _
"\\Business Contact Manager\", vbTextCompare) Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Get the root BCM folder
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Set olFolders = objNS.Session.Folders
If olFolders Is Nothing Then
MsgBox "Unable to get the list of Outlook Session folders"
Exit Sub
End If
Set bcmRootFolder = olFolders("Business Contact Manager")

' Get an XML recipient list
Dim strRecipientXML As String
strRecipientXML = _
GetRecipientXML(objNS, _
Application.ActiveExplorer.selection, _
bcmRootFolder)
If Trim(strRecipientXML) = "" Then
MsgBox "Please select at least one Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Locate the Marketing Campaigns folder
Dim marketingCampaignFolder As Outlook.Folder
Set marketingCampaignFolder = _
bcmRootFolder.Folders("Marketing Campaigns")

' Create a new Marketing Campaign
Const MarketingCampaignMessageClass = "IPM.Task.BCM.Campaign"
Dim newMarketingCampaign As Outlook.TaskItem
Set newMarketingCampaign = _
marketingCampaignFolder.Items.Add(MarketingCampaignMessageClass)

' Campaign Code
Dim campaignCode As Outlook.userProperty
Set campaignCode = newMarketingCampaign.ItemProperties("Campaign Code")
If campaignCode Is Nothing Then
Set campaignCode = _
newMarketingCampaign.ItemProperties.Add("Campaign Code", _
olText, False, False)
End If
campaignCode.value = CStr(Now())

' Campaign Type
Dim campaignType As Outlook.userProperty
Set campaignType = _
newMarketingCampaign.ItemProperties("Campaign Type")
If campaignType Is Nothing Then
Set campaignType = _
newMarketingCampaign.ItemProperties.Add("Campaign Type", _
olText, False, False)
End If

' Delivery Method
Dim deliveryMethod As Outlook.userProperty
Set deliveryMethod = _
newMarketingCampaign.ItemProperties("Delivery Method")
If deliveryMethod Is Nothing Then
Set deliveryMethod = _
newMarketingCampaign.ItemProperties.Add("Delivery Method", _
olText, False, False)
End If

' See if this is an e-mail or print letter
Dim title As String
If Email Then
title = "E-mail to "
campaignType.value = "E-mail"
deliveryMethod.value = "Word E-Mail Merge"
Else
title = "Letter to "
campaignType.value = "Direct Mail Print"
deliveryMethod.value = "Word Mail Merge"
End If

' Marketing Campaign Title
Select Case oItem.MessageClass
Case "IPM.Contact.BCM.Contact":
title = title & oItem.FullName
Case "IPM.Contact.BCM.Account":
title = title & oItem.FullName
Case "IPM.Task.BCM.Opportunity":
title = title & oItem.subject
Case "IPM.Task.BCM.Project"
title = title & oItem.subject
End Select

newMarketingCampaign.subject = title

' Content File
Dim contentFile As Outlook.userProperty
Set contentFile = newMarketingCampaign.ItemProperties("Content File")
If contentFile Is Nothing Then
Set contentFile = _
newMarketingCampaign.ItemProperties.Add("Content File", _
olText, False, False)
End If
contentFile.value = contentFilePath

' FormQuerySelection
Dim formQuerySelection As Outlook.userProperty
Set formQuerySelection = _
newMarketingCampaign.ItemProperties("FormQuerySelection")
If formQuerySelection Is Nothing Then
Set formQuerySelection = _
newMarketingCampaign.ItemProperties.Add("FormQuerySelection", _
olInteger, False, False)
End If
formQuerySelection.value = 9 ' Custom Query

' Recipient List XML
Dim recipientListXML As Outlook.userProperty
Set recipientListXML = _
newMarketingCampaign.ItemProperties("Recipient List XML")
If recipientListXML Is Nothing Then
Set recipientListXML = _
newMarketingCampaign.ItemProperties.Add("Recipient List XML", _
olText, False, False)
End If

' Set the Recipient List XML
recipientListXML.value = strRecipientXML

' Save the marketing campaign
newMarketingCampaign.Save

' Launch the new marketing campaign
newMarketingCampaign.Display (False)

Set recipientListXML = Nothing
Set formQuerySelection = Nothing
Set deliveryMethod = Nothing
Set contentFile = Nothing
Set campaignType = Nothing
Set campaignCode = Nothing
Set newMarketingCampaign = Nothing
Set marketingCampaignFolder = Nothing
Set bcmRootFolder = Nothing
Set olFolders = Nothing
Set oItem = Nothing
Set currentFolder = Nothing
Set objNS = Nothing
End Sub

' Returns an XML string that specifies the recipients
Function GetRecipientXML(objNS As Outlook.NameSpace, _
selectionList As Outlook.selection, _
bcmRootFolder As Outlook.Folder) As String
' Initialize the retun value to empty string
GetRecipientXML = ""
' Make sure we have a valid parameters
If objNS Is Nothing Or _
selectionList Is Nothing Or _
bcmRootFolder Is Nothing Then
Exit Function
End If

' Build the recipient XML
Dim strRecipientXML
strRecipientXML = "<ArrayOfCampaignRecipient>"

' Add all selected items to the recipient list
Dim oItem As Object
Dim astrContactEntryIDs() As String
ReDim Preserve astrContactEntryIDs(0)
Dim contactEntryId As Variant
Dim oParentEntryID As Object
Dim oParent As Object

For Each oItem In selectionList
If oItem Is Nothing Then
MsgBox "Warning: Item not found"
Else
' Only get the EntryID if this is a Business Contact, Account,
' Opportunity, or Business Project
Select Case oItem.MessageClass
' Business Contact
Case "IPM.Contact.BCM.Contact":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Account
Case "IPM.Contact.BCM.Account":
AddCampaignRecipient astrContactEntryIDs, oItem.EntryID
' Add Business Contacts associated with this Account
GetContactEnryIdsFromAccount bcmRootFolder, _
oItem.EntryID, _
astrContactEntryIDs
' Opportunity
Case "IPM.Task.BCM.Opportunity":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This opportunity is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
' If parent is Account, get account's contacts, too
On Error Resume Next
Set oParent = _
objNS.GetItemFromID(oParentEntryID.value)
If Err.Number = 0 Then
If Not (oParent Is Nothing) And _
oParent.MessageClass = _
"IPM.Contact.BCM.Account" Then
GetContactEnryIdsFromAccount _
bcmRootFolder, _
oParentEntryID.value, _
astrContactEntryIDs
End If
End If
On Error GoTo 0
End If
' Business Project
Case "IPM.Task.BCM.Project":
' Get the parent item
Set oParentEntryID = _
oItem.UserProperties("Parent Entity EntryID")
If oParentEntryID Is Nothing Then
MsgBox ("This project is not linked to a " & _
"Business Contact or Account")
Else
AddCampaignRecipient astrContactEntryIDs, _
oParentEntryID.value
GetContactEntryIDsFromProject oItem, _
astrContactEntryIDs
End If
Case Else:
' Invalid BCM type
Exit Function
End Select
End If
Next ' Add selected items

' Add recipients
If astrContactEntryIDs(0) <> "" Then
For Each contactEntryId In astrContactEntryIDs
If contactEntryId = "" Then
MsgBox "Warning: Contact not found"
Else
strRecipientXML = strRecipientXML & _
" <CampaignRecipient>" & _
" <EntryID>" & contactEntryId & "</EntryID>" & _
" </CampaignRecipient>"
End If
Next
End If

' Close the recipient list
strRecipientXML = strRecipientXML & "</ArrayOfCampaignRecipient>"

' Example XML for an external list of leads
Dim strExternalRecipientXML
strExternalRecipientXML = _
"<ArrayOfCampaignRecipient>" & _
" <CampaignRecipient>" & _
" <FileAs>Ashton, Chris</FileAs>" & _
" <EmailAddress>[email protected]</EmailAddress>" & _
" </CampaignRecipient>" & _
"</ArrayOfCampaignRecipient>"

Set oParent = Nothing
Set oParentEntryID = Nothing
Set oItem = Nothing

' Return the Recipient List XML
GetRecipientXML = strRecipientXML
End Function

' Returns an array of Business Contact EntryID's for the given Account
Sub GetContactEnryIdsFromAccount(bcmRootFolder As Outlook.Folder, _
strAccountID As String, _
astrContactIDs() As String)
' Check for a valid BCM root folder and Account EntryID
If bcmRootFolder Is Nothing Or Trim(strAccountID) = "" Then
Exit Sub
End If

' Locate the Business Contacts folder
Dim businessContacts As Outlook.Folder
Set businessContacts = _
bcmRootFolder.Folders("Business Contacts")
If businessContacts Is Nothing Or _
businessContacts.Items Is Nothing Then
Exit Sub
End If

' Setup the filter restriction string
Dim strRestriction As String
strRestriction = "[Parent Entity EntryID] = '" & strAccountID & "'"
Dim accountContacts As Outlook.Items
Set accountContacts = businessContacts.Items.Restrict(strRestriction)
If accountContacts Is Nothing Then
Exit Sub
End If

' Add each contact to the list of Account contacts
Dim oContact As Object
Dim i As Integer
For Each oContact In accountContacts
If oContact Is Nothing Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, oContact.EntryID
End If
Next
Set accountContacts = Nothing
Set businessContacts = Nothing
End Sub

' Get EntryID's for Project's related Business Contacts and Accounts
Sub GetContactEntryIDsFromProject(oProject As Outlook.TaskItem, _
astrContactIDs() As String)
If oProject Is Nothing Then
Exit Sub
End If
Dim associatedContacts As Outlook.userProperty
Set associatedContacts = _
oProject.UserProperties("Associated Contacts")
If (associatedContacts Is Nothing) Then
Exit Sub
End If
projectContacts = associatedContacts.value
Dim projectContact As Variant
Dim i As Integer
On Error Resume Next
For Each projectContact In projectContacts
If IsObject(projectContact) Then
MsgBox ("Invalid contact")
Else
AddCampaignRecipient astrContactIDs, CStr(projectContact)
End If
Next
On Error GoTo 0
Set associatedContacts = Nothing
End Sub

' Add a unique campaign recipient to the given array
Sub AddCampaignRecipient(ByRef astrRecipientIDs() As String, _
recipientID As String)
Dim arrFilter() As String
' Check to see if this is a duplicate recipient
arrFilter = Filter(astrRecipientIDs, recipientID, True, vbTextCompare)
If UBound(arrFilter) < 0 Then
Dim i As Integer
i = UBound(astrRecipientIDs)
' See if we need to grow the array length
If i > 0 Or astrRecipientIDs(0) <> "" Then
i = i + 1
ReDim Preserve astrRecipientIDs(0 To i)
End If
' Add this recipient to our list
astrRecipientIDs(i) = recipientID
End If
End Sub
'//////////////////////////////////////////////////////////////////////////

I want to use MS BCM in precisely the way EcoLouise describes.
I want to use MS BCM in precisely the way EcoLouise describes. It seems to me
inexplicable that it is not possible to create a list of accounts and then
send email to all linked contacts of each account.

Hopefully a technical friend can do something with the Macro, detailed later
on in the thread

:

Dave -- I haven't tried or studied the macro, but the description of it sounds
Dave -- I haven't tried or studied the macro, but the description of it
sounds like it does what you are looking for. What does it need to do that
it is not doing?

Regards.....Bill Kratz

:

Outlook BCM Contact to Word Form Letter Button
It shouldn't create a new marketing campaign. All it should do is take the contact info and the minute you click on the button, it should open the word document, do a mail merge of either the one contact or all the contacts selected and finish the merge opening the letters to be edited.

The fact that it opens the marketing campaign is this issue. At that point, do a mail merge is easier. The reason is this. I have sales reps that have been with the company for years. They want things to be easy...ie a button that says "Generate Quote Letter" and voila, the quote letter template is opened that the contact they were in contact info dumped in.

Thanks for any help, I'm working on the coding to see if I can fix it, but I still can't get around the new campaign thingy.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Dynamic HTTP Compression with IIS 5.0
http://www.eggheadcafe.com/tutorial...c3-512799fc857e/dynamic-http-compression.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top