Printing Envelopes 
Author Message
 Printing Envelopes

Hi all, I have quite the dilema!

I am trying to print an envelope from Word XP with VBA
code. The thing is, I want to be able to adjust the
AddressFromLeft and AddressFromTop properties. When I use
this code it works :

.AddressFromLeft = InchesToPoints(3.5)
.AddressFromTop = InchesToPoints(1.8)
.AddressStyle.Frame.TextWrap = False
.AddressStyle.Frame.WidthRule = wdFrameExact
.AddressStyle.Frame.Width = 360

But this code works only when I insert the envelope in the
document. However, I do not want to insert the envelope,
just print it! So, when I use the envelope.PrintOut
method, all the properties are reset to the default ones.
I use this :

ActiveDocument.envelope.PrintOut Address:=addresstext,
AddressFromLeft:=InchesToPoints(3.5),                
AddressFromTop:=InchesToPoints(1.8)

How would I go about modifying these options?

TIA
Jim



Sun, 01 Jan 2006 22:31:19 GMT  
 Printing Envelopes
Hi Jim,

Try:

With ActiveDocument.Styles("EnvelopeAddress").Frame
    .HorizontalPosition = InchesToPoints(3.5)
    .VerticalPosition = InchesToPoints(1.8)
End With

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a consulting basis.

Hope this helps
Doug Robbins - Word MVP

Quote:
> Hi all, I have quite the dilema!

> I am trying to print an envelope from Word XP with VBA
> code. The thing is, I want to be able to adjust the
> AddressFromLeft and AddressFromTop properties. When I use
> this code it works :

> .AddressFromLeft = InchesToPoints(3.5)
> .AddressFromTop = InchesToPoints(1.8)
> .AddressStyle.Frame.TextWrap = False
> .AddressStyle.Frame.WidthRule = wdFrameExact
> .AddressStyle.Frame.Width = 360

> But this code works only when I insert the envelope in the
> document. However, I do not want to insert the envelope,
> just print it! So, when I use the envelope.PrintOut
> method, all the properties are reset to the default ones.
> I use this :

> ActiveDocument.envelope.PrintOut Address:=addresstext,
> AddressFromLeft:=InchesToPoints(3.5),
> AddressFromTop:=InchesToPoints(1.8)

> How would I go about modifying these options?

> TIA
> Jim



Mon, 02 Jan 2006 07:57:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. printing envelopes with vba-access

2. Printing Envelopes Using Word

3. print envelope in a protected document

4. Use Contact info to print Envelope In MSWord.

5. Print envelope from desktop

6. using address from letter to print envelope?

7. Printing envelopes

8. Printing Envelope

9. Printing Envelopes and Labels

10. Printing Envelopes VB3.0 and Crystal Reports 4.0

11. Printing Envelopes and Labels

12. Print envelopes from VB

 

 
Powered by phpBB® Forum Software