View Single Post
  #26   Report Post  
Posted to microsoft.public.word.docmanagement
MoJR
 
Posts: n/a
Default Can I print an envelope without unlocking my document? Slight

Jay,
The macro as I wrote it is as follows;

Documents.Add Template:= _
"C:\Documents and Settings\MoJR\Application
Data\Microsoft\Templates\JR\XXXX.dot" _
, NewTemplate:=False, DocumentType:=0
Documents.Add Template:= _
"C:\Documents and Settings\MoJR\Application
Data\Microsoft\Templates\JR\XXXXXX.dot" _
, NewTemplate:=False, DocumentType:=0
With Dialogs(wdDialogFilePrint)
.Background = False
.Range = wdPrintRangeOfPages
.Pages = "0,1,2,2,3,3,3,4,1,5"
.Execute
End With
ActiveDocument.Close
It does not print the required copies of each page and it does not prompt me
for an envelope. I must have left out all the good parts. The pages and their
copies are;
1of page 1, 2 of page 2, 3 of page 3 and 3 of page 4. I obviously did not
enter the pages correctly in the macro. How do I enter these pages and their
copeis?
I have the macro you sent for printing 2 envelopes. It prints 1 envelope
with a delivery and return address and prints 1 envelope that uses the return
address as the delivery address. I don't really want the above macro to print
an envelope.
Thanks again in advance. You have the patience of a saint!!
mojr

"Jay Freedman" wrote:

It occurred to me, a bit belatedly, that the last version of the macro
adds the envelope to the start of the document as page 0. That means
your list of pages should be

.Pages = "0,1,2,2,3,3,3,4,4,4,5"

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Sun, 5 Mar 2006 20:12:27 -0800, MoJR
wrote:

Jay,
Thank you very, very much for your assistance!! I will work with this in the
morning.
mojr

"Jay Freedman" wrote:

Sorry, I got caught up in a high-priority job at work and forgot that
I left you waiting for this.

In the macro you already have, remove the line that contains
"ActiveDocument.PrintOut" and replace it with these lines:

With Dialogs(wdDialogFilePrint)
.Background = False
.Range = wdPrintRangeOfPages
.Pages = "1,2,2,3,3,3,4,4,4,5"
.Execute
End With

Of course, you can change the list of numbers to suit your needs.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Sun, 5 Mar 2006 14:57:16 -0800, MoJR
wrote:

Jay,
Please don't forget about the code mentioned in the is e-mail. I really do
need it to complete the document referenced. I tried doing this on my own and
failed miserably.
Thank You,
mojr

"Jay Freedman" wrote:

Getting the extra page copies won't be too hard, although I don't have time
right now to play with it until it works right. The idea is that instead of
using the ActiveDocument.PrintOut method, you use the
Dialogs(wdDialogsFilePrint) dialog object -- similar to the way the macro
now uses the Dialogs(wdDialogToolsEnvelopesAndLabels) object -- and use its
Pages parameter to specify a list of the pages and their duplicate copies,
like this:

.Pages = "1,2,2,3,3,3,4,4,4,5"

Getting two envelopes might be a little trickier. The problem is that the
macro now acts as if you pressed the Add to Document button in the Envelopes
dialog, and then prints the envelope along with the rest of the document.
But Word allows only one envelope at a time to be attached to a document; if
you try to hand it another envelope, it will replace the one that's already
there. But if the return envelope always has the same address, then that can
be a separate and unchanging document stored in a file on your disk; the
macro can just open it, print it, and close it before or after dealing with
the main document.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

MoJR wrote:
Jay,
Thank you for your help. I will finalize this stuff tomorrow.
Now. I have a document that has 5 pages in it. Three of them are
forms. I need 1 copy of page 1. I need 2 copies of page 2 and I need
3 copies each of pages 3 and 4 and 1 copy of page 5. I also would
like to add 2 envelopes to this document to be printed when I print
the other pages. 1 envelope had a return and a delivery address that
are different. The second evnope uses the return address for the
delivery address as well. What would be the best way to write
"something" that I could use for this? Is it possible to write it VBA
should I try a different program or should I leave you alone and go
screaming into the night!?!? I asked this question on one of the
forums earlier in the week. I can't remember which one and I haven't
received a response on it. Thank you again!!
mojr