C
Carrie
Hello everyone. I have the following code to insert an address entry
into a Word document. I am hoping to modify this code slightly to
insert each item on a separate line in a table.
'Determine which address method was chosen:
Select Case True
Case frmTransmittal.optGroupWise
Dim StrCode As String, strAddress As String, strCode1 As String,
_strCode2 As String, strCode3 As String
Dim iDoubleCR As Integer
Dim appGW As GWABLib.GWab
RecipName = "{<PR_DISPLAY_NAME>}"
StrCode = "{<PR_DISPLAY_NAME>}" & vbCr _
& "{<PR_TITLE>}" & vbCr _
& "{<PR_COMPANY_NAME>}" & vbCr _
& "{<PR_STREET_ADDRESS>}" & vbCr _
& "{<PR_LOCALITY>}" & ", " & "{<PR_STATE_OR_PROVINCE>}" & " "
& "{<PR_POSTAL_CODE>}" & vbCr
'
'Display the Select Name dialog, which lets the user choose
'a name from their address book
RecipName = Application.GetAddress(AddressProperties:=StrCode, _
UseAutoText:=False, displayselectdialog:=1, _
RecentAddressesChoice:=True, UpdateRecentAddresses:=True)
'If user cancelled out of Select Name dialog, quit
If RecipName = " " Then Exit Sub
This works great to insert the whole name and address into a Word doc.
Now I want to separate it. Title on one table row, Company on
another table row, etc. I tried separating it in the "Display the
Select Name" part but then it prompts the user to choose the name four
times.
Any help would be greatly appreciated!
into a Word document. I am hoping to modify this code slightly to
insert each item on a separate line in a table.
'Determine which address method was chosen:
Select Case True
Case frmTransmittal.optGroupWise
Dim StrCode As String, strAddress As String, strCode1 As String,
_strCode2 As String, strCode3 As String
Dim iDoubleCR As Integer
Dim appGW As GWABLib.GWab
RecipName = "{<PR_DISPLAY_NAME>}"
StrCode = "{<PR_DISPLAY_NAME>}" & vbCr _
& "{<PR_TITLE>}" & vbCr _
& "{<PR_COMPANY_NAME>}" & vbCr _
& "{<PR_STREET_ADDRESS>}" & vbCr _
& "{<PR_LOCALITY>}" & ", " & "{<PR_STATE_OR_PROVINCE>}" & " "
& "{<PR_POSTAL_CODE>}" & vbCr
'
'Display the Select Name dialog, which lets the user choose
'a name from their address book
RecipName = Application.GetAddress(AddressProperties:=StrCode, _
UseAutoText:=False, displayselectdialog:=1, _
RecentAddressesChoice:=True, UpdateRecentAddresses:=True)
'If user cancelled out of Select Name dialog, quit
If RecipName = " " Then Exit Sub
This works great to insert the whole name and address into a Word doc.
Now I want to separate it. Title on one table row, Company on
another table row, etc. I tried separating it in the "Display the
Select Name" part but then it prompts the user to choose the name four
times.
Any help would be greatly appreciated!