Is there a way to have an action button set to print a letter? I know it can be done with a handout, but I want it to print a letter.
no
Well, literally "no", but you can create a handout that has the content for the letter and print it from a button that way. You can change the code in your handout header so that it doesn't print whatever you normally print at the top of handouts when it prints "letters". Many of us do that by including some special character in the name of handouts that are to function as letters, matching on that character and if found stop the handout head stuff, otherwise print it.
Thank you, I was afraid of that.
It's really not bad. The "handout as letter" looks just like it otherwise would and your users are never the wiser. If you use a tilde (~) as the special character (use whatever you like that you're sure won't appear in any other handout titles), then the handout header mel could just be:
{if match(print_title,"~")>0 then "" else......whatever you need your actual handouts to do here}
then you'd name all of your handouts that are letters: ~MyHanoutName
I am giving this a try and I am having a little bit of difficulty in getting it to work. I keep getting a compiler error. Here is what I have as the current Handout Header. What from the above post would I add to get any handout that has ~ to not have a header, but keep all of my other handouts with the handout header?
{LOC.NAME}
{DATESTAMP()}
{LOC.ADDRESS1} {LOC.ADDRESS2} {LOC.CITY}, {LOC.STATE} {LOC.ZIP} Page 1
{LOC.FORMATPRIMPHONE} Fax: {LOC.FORMATFAXPHONE}
Patient Information
For :
{PATIENT.LABELNAME}
{PRINT_TITLE}
It just depends on what you want on the letter. for example, this leaves the loccation name, a date, etc. on the letter header, but omits the "For: " and patient.lablename and the handout title:
{sub(LOC.NAME, 1, size(loc.name)-6)}
{DATESTAMP()}
{LOC.ADDRESS1} {LOC.ADDRESS2} {LOC.CITY}, {LOC.STATE} {LOC.ZIP} Page 1
{LOC.PRIMPHONE} Fax: {LOC.FAXPHONE}
{if match(print_title,"~")>0 then "" else hret + hret + fmt("FOR: " + PATIENT.LABELNAME,"B") + hret + hret + fmt(PRINT_TITLE,"B,4") endif}
You could use the same sort of setup to omit/include other items from your standard handout header.
For this situation all I want is the handout header to be what it is now for all handouts except for the one letter (handout) with the ~ in the name. For this letter (handout) I don't want anything in the header. I will add what I need specifically for this letter (handout) in the letter itself. What do I need to do? Sorry, I am still new to MEL.
Something like this should work. I didn't add everything you have in this example, but you'll see how to proceed - just add your phone number mel code and use hret (hard return) for your line feeds as needed, and use plus sign (+) to concatenate the elements.
{if match(print_title,"~")>0 then "" else hret + hret + loc.name +hret+ datestamp() +hret+ loc.address1 + " "+loc.address2+", " + loc.state + loc.zip +hret + hret + fmt("Patient Information","b,2") +hret +hret + fmt("FOR: " + PATIENT.LABELNAME,"B") + hret + hret + fmt(PRINT_TITLE,"B,4") endif}
Thank you, I will play around with this.