Thread: [Solved] Help with Serial No. Macro
View Single Post
 
Old 05-14-2011, 03:29 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi pikerman,

To fix the duplicate printing, I've changed the line:
ActiveDocument.PrintOut
to:
If i > iStart Then ActiveDocument.PrintOut

I'm not sure what you mean by "the next time I run the demo, it prints the last page to be printed again". In my testing, it was the first certificate in the sequence that was duplicated. The above change fixes that.

As for the document being macro-enabled (docm format), that's a Word 2007 thing. Since you're using Word 2003, you can use the .doc format. However, the document still contains a macro and you'll still get the 'enable macros' prompt when you open it.

See attached.
Attached Files
File Type: zip Certificate Demo.zip (14.4 KB, 23 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote