Reply
 
Thread Tools Display Modes
  #1   Report Post  
Harlan
 
Posts: n/a
Default Can't insert mailing address w/out country

When I insert an address from the Contacts list, how do I get it to leave out
the 'Country' field? Right now, whenever I write a letter, I have to go back
and delete "United States" from the address
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

See the use of macrobutton fields to insert addresses from Outlook
http://www.gmayor.com/Macrobutton.htm and substitute the following code for
that produced there.

Public Sub InsertAddressFromOutlook()
Dim strCode, strAddress As String
Dim iDoubleCR As Integer

'Set up the formatting codes in strCode
strCode = "PR_DISPLAY_NAME" & vbCr
strCode = strCode & "PR_COMPANY_NAME" & vbCr
strCode = strCode & "PR_STREET ADDRESS" & vbCr
strCode = strCode & "PR_LOCALITY, PR_STATE_OR_PROVINCE" _
PR_POSTAL_CODE " & vbCr"
strCode = strCode & "PR COUNTRY" & vbCr

'Let the user choose the name in Outlook
strAddress = Application.GetAddress _
("", strCode, False, 1, , , True, True)
'Strip away the final "United States of America", if any
If Right(strAddress, 25) = "United States of America" & vbCr 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

'Insert the modified address at the current insertion point
Selection.TypeText strAddress
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Harlan wrote:
When I insert an address from the Contacts list, how do I get it to
leave out the 'Country' field? Right now, whenever I write a letter,
I have to go back and delete "United States" from the address



  #3   Report Post  
Graham Mayor
 
Posts: n/a
Default

Also try the following:

Copy the following exactly and save as an autotext entry called
AddressLayout (all one word)

{PR_GIVEN_NAME PR_SURNAME
}{PR_COMPANY_NAME
}{PR_POSTAL_ADDRESS}

(note the curly brackets are not field boundaries, but are typed from the
keyboard)

The variety of fields you can use in this manner are listed in the m
acrobutton article in my other post.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Harlan wrote:
When I insert an address from the Contacts list, how do I get it to
leave out the 'Country' field? Right now, whenever I write a letter,
I have to go back and delete "United States" from the address



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
insert graphics to all return address labels vjikki Mailmerge 1 January 25th 05 11:02 PM
no contacts appear to insert address Dolfan14 Microsoft Word Help 1 January 11th 05 02:21 PM
Word INSERT menu should include ADDRESS, (taken from Outlook AB) challca Microsoft Word Help 3 January 3rd 05 04:10 PM
can I insert a graphic in envelope return address? How? AngelinaWhite Microsoft Word Help 1 December 8th 04 09:29 PM
How do I get the company name to show up when I insert an address. MHelmle Mailmerge 3 December 1st 04 07:31 AM


All times are GMT +1. The time now is 11:41 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"