printing multiple copies VBA

G

GwenP

Hi

This line of code works perfectly in Word 2002 but ignores whatever is in
the text box now in Word 2003?

ActiveDocument.Printout Copies: = txtnum.value

I have tried ActiveDocument.Printout Copies: = val(txtnum.value) and this
does not work either?

Any suggestions anyone please?

Thanks
GwenP
 
J

Jonathan West

GwenP said:
Hi

This line of code works perfectly in Word 2002 but ignores whatever is in
the text box now in Word 2003?

ActiveDocument.Printout Copies: = txtnum.value

I have tried ActiveDocument.Printout Copies: = val(txtnum.value) and this
does not work either?

Any suggestions anyone please?

What *exactly* does txtnum.value contain? What kind of control is it?
 
G

GwenP

Thanks for your reply

txtnum.value is a text box on a user form created in Word 2003.
It contains a number that the user inputs as their number of copies for
printing.

I have tried it as a string and and integer or long but none of these work.

Thanks
GwenP
 
R

Russ

Gwen,
Just as a quick troubleshooting clue, does it work from the immediate window
using for example:

ActiveDocument.Printout Copies: = "2"
 
G

GwenP

Hi Russ

Oddly - no this does not work as "2" or 2?

Its like the printers are fixed at 1 copy but & ignores anything sent from
VBA. This is happening on all our printers but the same line of code is
working OK from the Word XP PC's?

Also - it does work if I just use File Print & change copies to 2.

Thanks
GwenP
 
R

Russ

Gwen,
I'm not sure what is going on, but it does seem like it because of the VBA
interface.

The next thing I would do, is compare the list of references activated
between the machines that work and those that don't. In other words go into
the VBA Editor in a machine and use the menu Tools/References...and see how
the references list differs among machines.

Also Certain add-ins (special templates) can mess things up. (i.e. Adobe PDF
add-in)

This below is from a previous posting talking about bookmarks:
*******
If this were mine, I would first rule out an extraneous (and very badly
behaved!) add-in. Try starting Word in safe mode (winword.exe /a).
=====(Gwen, try printing from safe mode)
Create the bookmark, save and re-open. Is the bookmark still there? If so,
then you job is to identify which global template or add-in is the culprit.
Ignore the name of the article and read here for ways to identify all loaded
add-ins:
<http://office.microsoft.com/en-au/word/HA011514521033.aspx?pid=CL1006364810
33> (cut and paste link between brackets, if clicking doesn't work)

Shauna Kelly. Microsoft MVP.
*******
 

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