printing envelope

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I print an envelope without unlocking my document?
Thank You,
James Penrod
 
MoJR said:
How can I print an envelope without unlocking my document?
Thank You,
James Penrod

Hi James,

You can't literally do that, because forms protection disables the Envelopes
wizard. With a macro, though, you can unprotect the document, run the
wizard, and immediately reprotect the document. Because you can't do
anything in the document while the dialog is open, the effect is that the
document is always "protected" against changes.

Put this macro in your template (see
http://www.gmayor.com/installing_macro.htm if needed) and then make a
toolbar button to run it
(http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm).

Sub MakeEnvelope()
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If

With Dialogs(wdDialogToolsEnvelopesAndLabels)
.DefaultTab = _
wdDialogToolsEnvelopesAndLabelsTabEnvelopes
.Show
End With

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Jay,
I created the macro. However, it doesn't populate the address box in the
envelope wizard. It also doesn't allow me to populate it either. Now what do
I do?
Jim
 
Hi Jim,

I'm not very surprised that running the macro doesn't pull the address
from the document into the wizard -- that's some bit of magic the
Microsoft developers did with the menu system, and it just isn't
available to VBA. It might be possible to program the macro to
simulate what the menu item does (scan the beginning of the document
for three to five one-line paragraphs together, which are presumably
the address of a letter). If the address items are all in text form
fields, that would be easier to program.

I'm mystified, though, by your inability to enter the address in the
wizard. It certainly doesn't give me any difficulty. Are you typing,
pasting, or trying something else?

It might also be useful to know what version of Word we're talking
about.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Jay,
Please de-mistify yourself. I had a very senior moment. I can actually type
in the address. Sorry!!
I'm using version 2003.
I figured this entire issue was one of those little 'things' you can't
change.
I guess my expectations are too high when it comes to computers. I feel that
computers should be advanced enough theses days to perform any task with very
little or no major programming involved. Maybe this situation is something
that can be patched or changed for future versions of Word.
Thank you very much for your help!!!
James Penrod
 
Jay,
Would it be possible to get the return address to stay in the wizard using
this macro?
I can copy and paste the address, but the return address will not stay in
the wizard.
Is there a simple setting somewhere?
MoJR
 
Hi Jim,

Yes, you can include the return address. Add this line to the macro
just before the .Show line:

.EnvReturn = Application.UserAddress

It uses the text in the Mailing Address box in the Tools > Options >
User Information dialog.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Jay,
Thanks very much. I'll try this immediately.
You are the man!!
Jim Penrod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top