Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
insert graphics to all return address labels | Mailmerge | |||
no contacts appear to insert address | Microsoft Word Help | |||
Word INSERT menu should include ADDRESS, (taken from Outlook AB) | Microsoft Word Help | |||
can I insert a graphic in envelope return address? How? | Microsoft Word Help | |||
How do I get the company name to show up when I insert an address. | Mailmerge |