Great solution. Thanks! Played with AutoIt, compiled an Exe file, and works well on my personal pc. But I don't have permission to do it for my company's notebook. It looks like the method of Option 3 is not stable. Some time it replaces the selected text directly to "/* */", and sometime it pastes clipboard content without "/* */". Maybe I did something not carefully and will do more tests. For option 3, the entire code can be added to the button directly, not necessary save to "C:\Temp\cmt_out.sas". The command for the button can be very long, like the following: gsubmit "options nonotes nosource;filename _cb clipbrd;filename _tmp temp;dm 'wcopy';data _null_;infile _cb;file _tmp;input;put _infile_;run;data _null_;infile _tmp;file _cb;input;_infile_='/* '||_infile_||' */';put _infile_;run;filename _cb clear;filename _tmp clear;options notes source;dm 'wpaste';"
... View more