The following script gets around that limitation to a large extent, by calling an external editor to do the double-byte work, and then using the mechanism Slaven wrote for the load HTML script.
Coupled with the script to view double-byte messages in an external editor, we have a workable (if somewhat clumsy) way to compose, edit, view etc. messages in almost any language.
Please, anybody feel free to extend this script by making it easier to select the right external editor, making provision for mulitple edit files, etc. This is just a starting point.
Please see this link for instructions on viewing messages with double-byte and other character-encodings.
- Code: Select all
{ Simple script designed to allow the sending of arbitrary message content from Poco.
{ This content can include double-byte characters, up to the limit of your computer's
{ ability to compose such a message and save it in HTML format.
{ Script inspired by Load HTML as Body script by Slaven, with modifications.
{ Place in public domain by frazmi 17 August 2004
{ Please test on your system!
{ Modifications and enhancements welcome!
IntToChar $QUOTE 34
IntToChar $CR 13
IntToChar $LF 10
AddStrings $CRLF $CR $LF
External $SimpleInstructions "Include simple instructions in blank email?" "YES"
External $SimpleInstructions2 "Show simple instructions at start of script?" "YES"
External $SendImmediate "Send edited message immediately?" "YES"
IF $SimpleInstructions2 = "YES" THEN ShowScriptInstructions
GOTO "Continue"
:ShowScriptInstructions
Set $Msg "Start a new message before you run this script. Queue it for sending."
AddStrings $Msg $CRLF "That will put it in the Out mailbox. Select the message."
AddStrings $Msg $CRLF "Then run this script with the message selected."
AddStrings $Msg $CRLF "Your word processor will open. Edit the message as you wish"
AddStrings $Msg $CRLF "and then save it as HTML format. Make sure you don't change"
AddStrings $Msg $CRLF "the file name. This simple script will break if you do."
MessageBox $Msg
:Continue
Set $Content $mailpath
AddStrings $Content "DoubleByte.html"
FileExists &FileExists $Content
If &FileExists Then UsePrevious
IF $SimpleInstructions = "YES" THEN "SetInstructions"
{Just insert a carriage return (so the file is not null)
Set $Explain $CRLF
GOTO "SaveBody"
:SetInstructions
{Put simple instructions into body of message. User will delete.
Set $Explain "Enter your formatted message here."
AddStrings $Explain $CRLF "Don't change the filename or the script will break."
AddStrings $Explain $CRLF "Make sure file is saved in RTF format."
AddStrings $Explain $CRLF "Delete these lines (or else they will appear in the message!"
AddStrings $Explain $CRLF "When you are finished editing, save the file and exit Word."
SaveBody $Explain $Content
:UsePrevious
Set $a $QUOTE
AddStrings $a $Content $QUOTE
ExecuteAndWait "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" $a
OpenBody $body $Content
AssignStyledBody %message $body
IF $SendImmediate = "YES" THEN "SendRightNow"
Set $Msg "The edited message has been inserted in the Out box."
AddStrings $Msg $CRLF "You need to send the message by executing the command"
AddStrings $Msg $CRLF "to send queued messages. Note: If you open the message in"
AddStrings $Msg $CRLF "in a compose window, the formatting will be lost."
SaveMessage %message Out
DeleteMessage %message
GOTO "Finalize"
:SendRightNow
SendMessage %message
DeleteMessage %message
MessageBox "Edited message sent."
:Finalize
Set $Msg "Do you want to delete the temporary edit file "
AddStrings $Msg $Content "?"
InputBox $Answer $Msg "No|Yes"
LowerCase $Answer
If $Answer = "Yes" Then DeleteEditFile
EXIT
:DeleteEditFile
DeleteFile $Content