Created
March 25, 2021 11:08
-
-
Save bjoerntx/b5284e427890d4119c305570d297787b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadDocument(document, filename) { | |
var st = TXTextControl.StreamType.InternalUnicodeFormat; | |
if (filename.endsWith(".docx") === true) { | |
st = TXTextControl.StreamType.WordprocessingML; } | |
else if (filename.endsWith(".doc") === true) { | |
st = TXTextControl.StreamType.MSWord; } | |
else if (filename.endsWith(".rtf") === true) { | |
st = TXTextControl.StreamType.RichTextFormat; } | |
else if (filename.endsWith(".html") === true) { | |
st = TXTextControl.StreamType.HTMLFormat; } | |
else if (filename.endsWith(".txt") === true) { | |
st = TXTextControl.StreamType.PlainText; } | |
TXTextControl.loadDocument(st, document); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment