PDA

View Full Version : [SOLVED:] Determinine address text entered in the CreateEnvelope dialog Recipient Address field



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

macropod
06-14-2014, 10:50 PM
hi Greg,

It's a bug affecting both Word 2003 & Word 2010 - probably bother versions, too. I reported it to the Word MVP group in July 2012. Even back then, MS dumped it into the closed - "Won’t Fix" category for the Word 2015 beta as a "legacy behaviour". Somehow I don't think fixing it's very high on their priority list.

gmaxey
06-15-2014, 07:32 PM
Paul,

Thanks. Sorted of expected that was the issue. Too bad. The dialogs could be very useful at times if not broken.