Goldmine Contacts into Word 2002

S

Shauna Koppang

I know how to do this in Word using a macro to open the
Outlook Contacts box and position the fields, but now I
have come across a customer who needs that same type of
integration with Goldmine. This is the code I have for
Outlook right now and I could sure use some help as I
have never even worked with Goldmine and an a beginner
programmer. Any suggestions for references for
integration with Goldmine and/ Maximizer? Thanks so much!

Shauna Koppang
(e-mail address removed)

Sub InsertAddressFromOutlook()
'Macro created by Shauna Koppang May 27, 2004
'Modifed by Jean-Guy Marcil - Word MVP

Dim strCode As String
Dim strAddress As String
Dim strAddressS As String
Dim iDoubleCR As Integer
Dim FullDetails As String
Dim SplitDetails As Variant

'Set up the formatting codes in strAddress with
Attention Line & Title

strCode = strCode & "<PR_COMPANY_NAME>" & vbVerticalTab
strCode = strCode & "<PR_STREET_ADDRESS>" &
vbVerticalTab
strCode = strCode & "<PR_LOCALITY>,
<PR_STATE_OR_PROVINCE>" & vbVerticalTab
strCode = strCode & "<PR_COUNTRY> <PR_POSTAL_CODE>" &
vbVerticalTab & vbVerticalTab
strCode = strCode & "Attention: " & vbTab
& "<PR_DISPLAY_NAME>" & vbVerticalTab
strCode = strCode & vbTab & vbTab & "<PR_TITLE>"

strCode = strCode & "__/__" & "<PR_GIVEN_NAME>"

'Let the user choose the name in Outlook
FullDetails = Application.GetAddress("", strCode,
False, 1, , , True, True)

' Splits out the Given_Name from the DisplayName
SplitDetails = Split(FullDetails, "__/__")
strAddress = SplitDetails(0)
strAddressS = SplitDetails(1)

' Remove the Return and replace with Line Break so
Address 1 Paragraph with Multi-lines
strAddress = Replace(strAddress, Chr(13), Chr(11))

'Insert the Recipient Address at the current location
Selection.TypeText strAddress

'Makes the Attention & Title block bold
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveUp Unit:=wdLine, Count:=1,
Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.EndKey Unit:=wdLine


'Moves and selects salutation placeholder and puts in
GIVEN_NAME
Selection.NextField.Select
Selection.TypeText strAddressS

'Eliminate blank lines by looking for two carriage
returns in a row
iDoubleCR = InStr(strAddress, vbCr & vbCr)

While iDoubleCR <> 0
strAddress = Left(strAddress, iDoubleCR - 1) & Mid
(strAddress, iDoubleCR + 1)
iDoubleCR = InStr(strAddress, vbCr & vbCr)
Wend

'Selects the RE: placeholder
Selection.NextField.Select

End Sub
 

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