Print a range to a XPS document?

C

Charlotte E.

Hi guys,

Do any of you have a example code for printing a range to a XPS document?

I'm struggling with it, but can't make it work...
....well, it (kind of) works, but I'm not pleased with the (workaroud) way
I'm using, and was wondering if someone know of a cool/proper way of doing
it?

Thanks,

CE
 
C

Charlotte E.

Can we see your code?

It's really no big deal:

- I save the current ActivePrinter and PrintArea in two temporary variables.
- Change the ActivePrinter to the Microsoft XPS printer
- Change the PrintArea to the range I want to print.
- Do the Worksheet.PrintOut
- Reset the ActivePrinter and original PrintArea back from the temporary
variables.

Simple as that, but I still don't like relaying on an external printer, and
was wondering, if there was some sort of 'Export to XPS' as there are with
..PDF?


CE
 
G

GS

Thanks, Garry, but that applys to PDF, and I prefer XPS :)

You can specify XPS in place of PDF for the output type as since Excel
12 both formats are available.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

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

Top