gmaxey
06-14-2014, 01:51 PM
Does anyone know how to use VBA to determine the address entered in the recipient field of the CreateEnvelop dialog?
I can set it to a multiline value using the .AddrText property, but if I enter a multiline value in the dialog the .AddrText property only returns a the fist line! Thanks.
Sub ScratchMacroI()
'A basic Word macro coded by Greg Maxey
With Dialogs(wdDialogToolsCreateEnvelope)
'I can set the address field of the dialog with multiple lines of text _
using the .AddrText property
.AddrText = "121 Miller Street" & vbCr & "Hampton VA, 12345"
.Show
End With
lbl_Exit:
Exit Sub
End Sub
Sub ScratchMacroII()
'A basic Word macro coded by Greg Maxey
With Dialogs(wdDialogToolsCreateEnvelope)
.Show
'However when I type multiple lines in the address field and try to _
get the text entered, it only returns the first line :-(.
MsgBox .AddrText
End With
lbl_Exit:
Exit Sub
End Sub
I can set it to a multiline value using the .AddrText property, but if I enter a multiline value in the dialog the .AddrText property only returns a the fist line! Thanks.
Sub ScratchMacroI()
'A basic Word macro coded by Greg Maxey
With Dialogs(wdDialogToolsCreateEnvelope)
'I can set the address field of the dialog with multiple lines of text _
using the .AddrText property
.AddrText = "121 Miller Street" & vbCr & "Hampton VA, 12345"
.Show
End With
lbl_Exit:
Exit Sub
End Sub
Sub ScratchMacroII()
'A basic Word macro coded by Greg Maxey
With Dialogs(wdDialogToolsCreateEnvelope)
.Show
'However when I type multiple lines in the address field and try to _
get the text entered, it only returns the first line :-(.
MsgBox .AddrText
End With
lbl_Exit:
Exit Sub
End Sub