// This macro reformats text as a quote for inclusion in an email // message and copies it to the Windows clipboard for pasting into // a message in one's mailer program. The text is rewrapped for a // right margin of 65, and ">> " is placed at the beginning of each // line. Both features can be changed easily in the code. // // When invoked as an auto-execute macro (for example from a desktop // shortcut with a command line like: // D:\vedit\vpw.exe -k -x d:\vedit\quote.vdm ), it starts by copying // the current clipboard contents into the edit buffer, and it ends // by copying the modified contents back to the clipboard and exiting. // // When invoked manually (for example from a custom USER menu or from // the {Misc, Load/Execute Macro} menu), it uses the text currently // in the edit buffer. When done, it copies the text to the clipboard // and beeps but does not exit. // // Author: Jay Sage, // Created: 10 Feb 1999 // Last Modified: 23 Feb 1999 // more modifications 23 Mar 1999 Ch.Ziemski // // Modification history: // // 23 Mar 1999: Sound crashes NT -> workaround // Replace() for inserting quote characters // 23 Feb 1999: Cosmetic changes for release. // 12 Feb 1999: Discovered Clip_Ins and Clip_Copy_Block commands. // 11 Feb 1999: Made it work with text already in buffer so // that it could be used with manually created and // edited text //------------------------------------------------------// // // // If macro invoked from command line, read clipboard // // // //------------------------------------------------------// if( Is_Auto_Execution ) { Clip_Ins() // copy clipboard to buffer } //------------------------------------------------------// // // // Reformat the text between margins of 2 and 63 // // // //------------------------------------------------------// Margin_Right(63) Begin_of_File() // reformat all paragraphs to left margin of 2 while( ! At_EOF ) { Format_Para(2) } // make sure last line has crlf if( Cur_Col > 1 ){ Ins_Newline() } //------------------------------------------------------// // // // Add the quote characters to each line // // // //------------------------------------------------------// // insert ">>" at beginning of each line Begin_of_File() Ins_Text('>>') Replace("|N","|N>>",ALL+ADVANCE+NOERR) //------------------------------------------------------// // // // Add extra blank line and copy text to clipboard // // // //------------------------------------------------------// Ins_Newline() Clip_Copy_Block( 0 , File_Size ) if(Is_WinNT){ alert() // Sound() crashes WinNT! } else { Sound( 1760 , 200 ) // signal user that process is complete } //------------------------------------------------------// // // // If macro auto-executed, quit without asking // // // //------------------------------------------------------// if( Is_Auto_Execution ) { Qally }