Hello,
I'm trying to use PRINTHANDOUT to call a handout in my form. I think I am calling it correctly -- as I've used the same line of code without problem in the past. This is what I'm trying to do:
if match(emcheckarray[b], "CPT-99211")>0 Then
PRINTHANDOUT("Handouts\Enterprise\Post Visit Summary")
document.vsprinted = "x"
else if ....
When the if statement returns as true the print handout is called and this is what the mel trace shows:
PRINTHANDOUT("Handouts\\Enterprise\\Post Visit Summary")
Notice the extra backslash that is added. In this case the printhandout fails and I get a cannot find handout popup. Has anyone else come across this? I tried deleting and recreating the button, but the error continues. Any suggestions would be appreciated.
bhoover said:
Hello,
I'm trying to use PRINTHANDOUT to call a handout in my form. I think I am calling it correctly -- as I've used the same line of code without problem in the past. This is what I'm trying to do:
if match(emcheckarray[b], "CPT-99211")>0 Then
PRINTHANDOUT("Handouts\Enterprise\Post Visit Summary")
document.vsprinted = "x"
else if ....
When the if statement returns as true the print handout is called and this is what the mel trace shows:
PRINTHANDOUT("Handouts\\Enterprise\\Post Visit Summary")
Notice the extra backslash that is added. In this case the printhandout fails and I get a cannot find handout popup. Has anyone else come across this? I tried deleting and recreating the button, but the error continues. Any suggestions would be appreciated.
I found that the PRINTHANDOUT calls had to be in the form's .xlw file in order not to get the extra backslashes in the path If you are calling PRINTHANDOUT from a function then you will need to include the '!' - e.g. !fn PrintVisitSummary() - else calling it directly from a watcher expression should be fine too.
Thank you for the suggestion. You got me on the right track. I was using a button to call my function with the code above in it. When I looked at the .xlw file the PRINTHANDOUT() was not there. After trying a couple things I found the easiest was to put the function in the button directly rather than call it from the worksheet.
This is one of those random things you don't know about until it happens to you. Thanks again for the help.
Brad