PDA

View Full Version : Print two copies of the same page but add watermark to one of the copies



rbrewington
07-31-2008, 01:20 PM
I've posted before, but I've since switched my medical record template back to a Word 2003 format docutment with form fields. One issue I have is with generating computer printed prescriptions for patients. I would like to be able to use the computer to print the prescriptions onto a form to cut down on errors from my sloppy handwriting etc... I need a way to print both an original and an exact copy of that except with a watermark that says it is a "chart copy" once I am ready. I would prefer this to use one single page that is simply printed plainly once and then printed again with the watermark added, but I'm not sure how to do this.

As a bonus, in addition I'd also like to have a way to allow a userform to run when the user is ready to print that allows the user to either select the eniter document, the note portion of the document only, or the prescription portion of the document only. This is because this prescription page is currently attached to other parts of the template that might need to be printed at different times.

Anyway, any suggestions or pointing me in some kind of direction would be helpful.

Thanks,

Richard Brewington

Charlize
08-01-2008, 03:22 AM
This is for the watermark part : http://www.vbaexpress.com/kb/getarticle.php?kb_id=588

Charlize

mdmackillop
08-03-2008, 03:41 AM
If your printer can add watermarks, here's a simple cheat that I use.
Add another copy of your printer set up to print the watermark to your list of printers.
You can then print both copies from code, or simply select the chosen "printer"

tmp = ActivePrinter
ActivePrinter = "Plain"
ActiveDocument.PrintOut
ActivePrinter = "Watermark"
ActiveDocument.PrintOut
ActivePrinter = tmp


This method can also be used for printing to different printer trays etc.

macropod
08-03-2008, 11:11 PM
Hi rbrewington,

It seems to me that, unless your form uses checkboxes, the simplest way to do this would be to set your form up as a document foramtted with a 'different first page' under File|Page Setup|Layout. Then:
. insert your watermark into the 1st or 2nd page header (whichever you prefer).
. make sure each of your formfields has its properties set to 'calculate on exit'.
. bookmark the entire existing first page (ie Ctrl-A then Insert|Bookmark > Name)
. go to the end of the document insert a paragraph mark (<Enter>) then a page break (Ctrl-<Enter>) after the bookmark
. on the new page, insert a cross-reference to the bookmark (Insert|Cross-Reference > Bookmarks > Name).

If your form does use checkboxes, you'll need a macro to replicate the checkbox state on the duplicate page. An alternative is to use a dropdown formfield with Yes/No responses, thus obviating the need for a macro.

rbrewington
08-06-2008, 10:50 AM
Sorry it's taken a while to back to all of you. This was one problem that I knew I needed help on, but I've been diverted to other parts of the project. Right now I think I'll need to use a picture watermark because I need 6 copies of the watermark distributed in each cell of a 2 column and 3 row table that takes up the entire page. Each cell needs a text watermark, but I can't figure out how to have the text layed out in that orientation by just using the text watermark option.

Finally I looked at all three solutions. I think it would probably be easiest and more flexible just to have two copies of the last page of this template and automatically update the second copy plus keep the watermark going on that page. Unfortunately I do use a checkbox and it really needs to be a checkbox and not a drop down. Can someone point me in the correct direction to have a checkbox status automatically updated based on another checkbox's status?

Thanks for all the help,

Ryan

macropod
08-06-2008, 03:09 PM
Hi Ryan,

Here's some code you might use as an 'on-exit' macro for a checkbox formfield named 'Check1'. If it's state is 'True' it sets the state of checkbox formfields 'Check2' to 'Check4' to 'False':
Sub Check1Exit()
With ActiveDocument
If .FormFields("Check1").Result = True Then
.FormFields("Check2").Result = False
.FormFields("Check3").Result = False
.FormFields("Check4").Result = False
End If
End With
End SubDo note that the code is triggered by the user tabbing out of the formfield - if they simpy select another formfield, it won't fire. To get around that, you could use an 'on-entry' macro for the same checkbox, coded along the lines of:
Sub Check1Entry()
With ActiveDocument
If .CustomDocumentProperties("CheckState") = 2 Then Call Check2Exit
If .CustomDocumentProperties("CheckState") = 3 Then Call Check3Exit
If .CustomDocumentProperties("CheckState") = 4 Then Call Check4Exit
.CustomDocumentProperties("CheckState") = 1
End With
End SubFor the above sub, you'd create a Custom Document Property named "CheckState" (via File|Properties|Custom) and set its intital value to, say, 0.