I want to create a desktop icon that will open word and automatically open
the the "Tools | Letters and Mailings", "Envelopes and Labels" window.

I have recorded a macro that opens this window, but the window is modal so
the macro cannot be terminated until the window is closed and the code behind
the macro uses ActiveDocument.Envelope.Insert with the proper arguments to
insert the envelope.

I have also tried to use Sendkeys in the macro to send the [Alt] + "T"
(Tools), [Alt] + "e" (Letters and Mailings), [Alt] + "E" (Envelopes and
Labels) {Sendkeys "%(TeE)"} but when I run it, the current time gets inserted
into the document.

Any ideas?

Re: Run a macro in Word from command line to open envelope window by Doug

Doug
Wed Jul 20 13:17:16 CDT 2005

If what you want to do is open Word and have an envelope as the active
document, you should create a template that is based on the desired envelope
and then use the /ttemplatename startup switch to start Word with a new
document based on a template other than the normal.dot template.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"DBishop" <DBishop@discussions.microsoft.com> wrote in message
news:7BE24CFF-90EB-4CBA-B59D-CAA969299627@microsoft.com...
>I want to create a desktop icon that will open word and automatically open
> the the "Tools | Letters and Mailings", "Envelopes and Labels" window.
>
> I have recorded a macro that opens this window, but the window is modal so
> the macro cannot be terminated until the window is closed and the code
> behind
> the macro uses ActiveDocument.Envelope.Insert with the proper arguments to
> insert the envelope.
>
> I have also tried to use Sendkeys in the macro to send the [Alt] + "T"
> (Tools), [Alt] + "e" (Letters and Mailings), [Alt] + "E" (Envelopes and
> Labels) {Sendkeys "%(TeE)"} but when I run it, the current time gets
> inserted
> into the document.
>
> Any ideas?



RE: Run a macro in Word from command line to open envelope window by DBishop

DBishop
Wed Jul 20 17:05:02 CDT 2005

That would work, but the actual envelope template has everything that is
needed to enter the information, select whether or not to print the barcode,
automatically add it to a document, vs. just printing the envelope
immediately, etc. I would much rather be able to directly open the Envelopes
and Labels window and then enter the address from there.

Any more suggestions would be appreciated.

RE: Run a macro in Word from command line to open envelope window by Peter

Peter
Fri Sep 30 19:59:01 CDT 2005

Try this:

Create a macro and add the following code:

- Dialogs(wdDialogToolsEnvelopesAndLabels).Show
- Add the macro to a toolbar or create your own
- Click the button on the toolbar to open the dialog box

This won't get an icon to automatically load the function, but at least you
don't have to go all the way through the tool menu to get to it. I was using
Word 2003. Hope this helps.


"DBishop" wrote:

> I want to create a desktop icon that will open word and automatically open
> the the "Tools | Letters and Mailings", "Envelopes and Labels" window.
>
> I have recorded a macro that opens this window, but the window is modal so
> the macro cannot be terminated until the window is closed and the code behind
> the macro uses ActiveDocument.Envelope.Insert with the proper arguments to
> insert the envelope.
>
> I have also tried to use Sendkeys in the macro to send the [Alt] + "T"
> (Tools), [Alt] + "e" (Letters and Mailings), [Alt] + "E" (Envelopes and
> Labels) {Sendkeys "%(TeE)"} but when I run it, the current time gets inserted
> into the document.
>
> Any ideas?

Re: Run a macro in Word from command line to open envelope window by Graham

Graham
Sat Oct 01 00:31:02 CDT 2005

The original replies were not reproduced, but the simplest method of having
access to envelopes from the desktop is to drop a shortcut to an envelope
template there. There are sample templates for download from my web site
that would do the job.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Peter wrote:
> Try this:
>
> Create a macro and add the following code:
>
> - Dialogs(wdDialogToolsEnvelopesAndLabels).Show
> - Add the macro to a toolbar or create your own
> - Click the button on the toolbar to open the dialog box
>
> This won't get an icon to automatically load the function, but at
> least you don't have to go all the way through the tool menu to get
> to it. I was using Word 2003. Hope this helps.
>
>
> "DBishop" wrote:
>
>> I want to create a desktop icon that will open word and
>> automatically open the the "Tools | Letters and Mailings",
>> "Envelopes and Labels" window.
>>
>> I have recorded a macro that opens this window, but the window is
>> modal so the macro cannot be terminated until the window is closed
>> and the code behind the macro uses ActiveDocument.Envelope.Insert
>> with the proper arguments to insert the envelope.
>>
>> I have also tried to use Sendkeys in the macro to send the [Alt] +
>> "T" (Tools), [Alt] + "e" (Letters and Mailings), [Alt] + "E"
>> (Envelopes and Labels) {Sendkeys "%(TeE)"} but when I run it, the
>> current time gets inserted into the document.
>>
>> Any ideas?