Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Envelope Dilemma, Part 2 (Word 97SR2)

    For the "envelope data" ( return address, recipient address and logo) to print,
    the user will click the Ok button on the form below.

    This is my attempt at replacing the built-in Word dialog as mentioned in Part 1.

    What code will get the envelope to print?

    If I use the .execute method on the dialog (as in:

    set dlg = dialogs(wdDialogToolsEnvelopesAndLabels)
    With dlg
    .EnvOmitReturn = false
    .execute
    End with

    Word inserts an envelope page into the document. I don't want that. The user must
    then print the page to get the envelope printed then delete the envelope page.
    I want the the envelope to print when the user presses the Ok button on the form below. How can I program that?
    Attached Images Attached Images
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Kevin,

    It looks like you can do this:

    <pre>Dim doc As Document

    Set doc = ActiveDocument

    set dlg = dialogs(wdDialogToolsEnvelopesAndLabels)
    With dlg
    .EnvOmitReturn = false
    End with

    doc.Envelope.PrintOut
    </pre>

    If that doesn't work, you could try:

    Leaving the .Execute in and adding the following line after the .execute

    doc.PrintOut , , wdPrintFromTo, , 1, 1
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Add this parameter:

    .PrintEnvLabel = True

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    That indeed works. And thank you Jefferson. Now, I see that parameter in the "Built-in Dialog Box Argument List" in the help. But how did you know what it does? In other words, do you have some documentation on these arguments?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Bryan, Thanks for your reply. The problem with this solution is the envelope page still gets added to the document. I suppose if I could allow the page to insert, print it then delete it, then this would work for me.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    The only remaining problem is this: I need to format the return address with all lines bold and centered to right of the logo.

    By inserting the envelope into the document, I can put a text box next to the logo and format the return address.

    But the Return Address field in the Word Envelopes and Labels dialog (which is what the .PrintEnvLabel uses to print the envelope) does not appear to allow any formatting.

    Do you know if there Is there a way to format that field?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    ...which leads me to the next obvious question: What's the easiest way to remove an envelope from a document?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Kevin,

    Given all the work you are having to do, why not just create a new document, with .Visible=False, use Page Setup to set it to match your envelopes, put the text boxes where you want, print it and delete it again?

    StuartR

  9. #9
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    I only have W2K here, but when the envelope get inserted into the document for me, it is at the beginning of the document, so...

    ActiveDocument.Sections(1).Range.Delete

    Will get rid of the first section, which is the envelope.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    It's a good thing you can think on a Friday. I can't. Nicely done.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Believe me, do. (A little Beatlesesque lingo there for you.) I thought of this and have not completely axed the idea. The delete part would certainly be easy.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  12. #12
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    It's a gift <img src=/S/smile.gif border=0 alt=smile width=15 height=15>.

    No wait a minute, it's 'cause I'm bored outta my skull and needed something to do.

    It's Friday afternoon, before a 3 day weekend, followed by almost 2 weeks off, and nothing to do (Just don't tell my boss that <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> )
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  13. #13
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    <img src=/S/bubbles.gif border=0 alt=bubbles width=31 height=17> Bored, huh? Well, don't spend all your time off here. That'll really drive you <img src=/S/nuts.gif border=0 alt=nuts width=15 height=15>
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  14. #14
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    <img src=/S/nuts.gif border=0 alt=nuts width=15 height=15>, me??


    Too late <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35> <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35> <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35> <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  15. #15
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Dilemma, Part 2 (Word 97SR2)

    Back on topic for a minute:

    What do you know about the autotext entries EnvelopeExtra1 and 2? I'm using one of these (the 1) for the logo. If Word finds these autotext pieces, it'll use them in the return address. I'm wondering if I can use the Extra2 to slap the nicely formatted return address up there next to the logo. Then, the envelope should print without having to insert it into the doc. That would be nice.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •