L
Legal Learning
I have several macros that "grab" addresses from Outlook and put them into my
form/letter in Word in 2003. Now that the upgrade has happened all the
autotext and the rest of my code works fine EXCEPT the get address part of
the code. It returns the value in my variables, however, it simply does not
return the value to the textbox fields in my form and of course does not put
it into the final letter document. Here is my code. Again, the variables (
rcpFirstName1, rcpLastName1, rcpAddress1) are returned correctly and the
frmContacts.txtName1.Value, frmContacts.txtC1.Value and
frmContacts.txtSal1.Value are also returned correctly. However, they do not
populate the fields on the dialog nor do they get entered into the final
letter.
Public Sub cmdOC1_Click()
DialogReturn = rcpDisplayName1 =
Application.GetAddress(AddressProperties:="<PR_DISPLAY_NAME>",
DisplaySelectDialog:=1)
rcpCompanyName1 =
Application.GetAddress(AddressProperties:="<PR_COMPANY_NAME>",
DisplaySelectDialog:=2)
rcpFirstName1 =
Application.GetAddress(AddressProperties:="<PR_GIVEN_NAME>",
DisplaySelectDialog:=2)
rcpLastName1 = Application.GetAddress(AddressProperties:="<PR_SURNAME>",
DisplaySelectDialog:=2)
rcpBusFaxNo1 =
Application.GetAddress(AddressProperties:="<PR_BUSINESS_FAX_NUMBER>",
DisplaySelectDialog:=2)
If rcpCompanyName1 = "" Then
strAddress1 = "<PR_POSTAL_ADDRESS>"
Else
strAddress1 = "<PR_COMPANY_NAME>" & vbCr & "<PR_POSTAL_ADDRESS>"
End If
rcpAddress1 = Application.GetAddress(AddressProperties:=strAddress1,
DisplaySelectDialog:=2)
'populate fields in frmContacts
If DialogReturn = False Then
frmContacts.txtName1.Value = rcpFirstName1 & " " & rcpLastName1
frmContacts.txtC1.Value = rcpAddress1
' frmContacts.txtSal1.Value = rcpFirstName1 & " " & rcpLastName1
mReturn10 = True
Else
mReturn10 = False
End If
End Sub
This macro is being used a LOT in quite a few firms so any help would be
greatly appreciated!
form/letter in Word in 2003. Now that the upgrade has happened all the
autotext and the rest of my code works fine EXCEPT the get address part of
the code. It returns the value in my variables, however, it simply does not
return the value to the textbox fields in my form and of course does not put
it into the final letter document. Here is my code. Again, the variables (
rcpFirstName1, rcpLastName1, rcpAddress1) are returned correctly and the
frmContacts.txtName1.Value, frmContacts.txtC1.Value and
frmContacts.txtSal1.Value are also returned correctly. However, they do not
populate the fields on the dialog nor do they get entered into the final
letter.
Public Sub cmdOC1_Click()
DialogReturn = rcpDisplayName1 =
Application.GetAddress(AddressProperties:="<PR_DISPLAY_NAME>",
DisplaySelectDialog:=1)
rcpCompanyName1 =
Application.GetAddress(AddressProperties:="<PR_COMPANY_NAME>",
DisplaySelectDialog:=2)
rcpFirstName1 =
Application.GetAddress(AddressProperties:="<PR_GIVEN_NAME>",
DisplaySelectDialog:=2)
rcpLastName1 = Application.GetAddress(AddressProperties:="<PR_SURNAME>",
DisplaySelectDialog:=2)
rcpBusFaxNo1 =
Application.GetAddress(AddressProperties:="<PR_BUSINESS_FAX_NUMBER>",
DisplaySelectDialog:=2)
If rcpCompanyName1 = "" Then
strAddress1 = "<PR_POSTAL_ADDRESS>"
Else
strAddress1 = "<PR_COMPANY_NAME>" & vbCr & "<PR_POSTAL_ADDRESS>"
End If
rcpAddress1 = Application.GetAddress(AddressProperties:=strAddress1,
DisplaySelectDialog:=2)
'populate fields in frmContacts
If DialogReturn = False Then
frmContacts.txtName1.Value = rcpFirstName1 & " " & rcpLastName1
frmContacts.txtC1.Value = rcpAddress1
' frmContacts.txtSal1.Value = rcpFirstName1 & " " & rcpLastName1
mReturn10 = True
Else
mReturn10 = False
End If
End Sub
This macro is being used a LOT in quite a few firms so any help would be
greatly appreciated!