• Extracting Address From A Letter (Word 2000 SR-1)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Extracting Address From A Letter (Word 2000 SR-1)

    Author
    Topic
    #365785

    When you create a letter in Word and then activate the Labels/Envelope dialog box, Word typically finds the address in your letter document.

    Is there any way to ‘find’ this address within VBA?

    Viewing 0 reply threads
    Author
    Replies
    • #565373

      Yes, there is.

      Set dlg = Dialogs(wdDialogToolsEnvelopesAndLabels)

      With dlg
      .DefaultTab = wdDialogToolsEnvelopesAndLabelsTabEnvelopes
      .EnvOmitReturn = True
      .ExtractAddress = True
      bla, bla, bla

      • #565378

        Thanks Kevin. The .ExtractAddress command allows me to get the address in the dialog box, but ultimately, I would like to get the address in a string variable without displaying the built-in dialog box. In addition, even if I display the built-in dialog box, I seem to only capture the first line of the address (from the .AddrText property of the dialog box).

        Any further ideas? Thanks!

    Viewing 0 reply threads
    Reply To: Extracting Address From A Letter (Word 2000 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: