If your regional setting in Windows is set to United States, the United
States shouldn't be added to inserted PostalAddress fields, however see
http://www.gmayor.com/Macrobutton.htm in conjunction with the following
modified macro:
Public Sub InsertAddressFromOutlook()
Dim strCode As String
Dim strCountry As String
Dim strAddress As String
Dim iDoubleCR As Integer
'Set up the formatting codes in strCode
strCode = "{<PR_DISPLAY_NAME_PREFIX> }<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr
strCode = strCode & "<PR_COMPANY_NAME>" & vbCr
strCode = strCode & "<PR_POSTAL_ADDRESS>" & vbCr
strCountry = "<PR_COUNTRY>"
'Let the user choose the name in Outlook
strAddress = Application.GetAddress("", _
strCode, False, 1, , , True, True)
If strAddress = "" Then
MsgBox "User cancelled or no address listed", , "Cancel"
Exit Sub
End If
strCountry = Application.GetAddress("", strCountry, _
False, 2, , , True, True)
'Strip away the final "United States Of America", if any
If InStr(strCountry, "United States") Then
strAddress = Left(strAddress, Len(strAddress) - 25)
End If
'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
Selection.TypeText strAddress
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>