Hi,
i have an apparent problem with MS Word OLE which i'm hoping someone would know the answer to.
i have the following code:
function ReturnDocParagraphString: widestring;
const
{Constants for enum WdUnits }
wdCharacter = $00000001;
wdParagraph = $00000004;
{Constants for enum WdMovementType}
wdExtend = $00000001;
begin
wrdApp.Selection.EndOf(Unit:=wdParagraph, Extend:=wdExtend);
wrdApp.Selection.Copy;
Result := TntClipboard.AsWideText;
end;
i have a TntMemo that i then copy the result into:
TntMemo1.Lines.Text := ReturnDocParagraphString;
What i see in the TntMemo is question marks always with this bit of code, except when pasting standard ANSI characters. However if i copy some Chinese text manually and then use this code to paste it into the TntMemo:
TntMemo1.Lines.Text := TntClipboard.AsWideText;
then i see the Chinese characters displayed correctly in the TntMemo.
So it appears that the declaration:
wrdApp.Selection.Copy
doesn't understand unicode characters? Or what could it be?
Does anyone know how to make this work properly?
Thanks in advance.
i have an apparent problem with MS Word OLE which i'm hoping someone would know the answer to.
i have the following code:
function ReturnDocParagraphString: widestring;
const
{Constants for enum WdUnits }
wdCharacter = $00000001;
wdParagraph = $00000004;
{Constants for enum WdMovementType}
wdExtend = $00000001;
begin
wrdApp.Selection.EndOf(Unit:=wdParagraph, Extend:=wdExtend);
wrdApp.Selection.Copy;
Result := TntClipboard.AsWideText;
end;
i have a TntMemo that i then copy the result into:
TntMemo1.Lines.Text := ReturnDocParagraphString;
What i see in the TntMemo is question marks always with this bit of code, except when pasting standard ANSI characters. However if i copy some Chinese text manually and then use this code to paste it into the TntMemo:
TntMemo1.Lines.Text := TntClipboard.AsWideText;
then i see the Chinese characters displayed correctly in the TntMemo.
So it appears that the declaration:
wrdApp.Selection.Copy
doesn't understand unicode characters? Or what could it be?
Does anyone know how to make this work properly?
Thanks in advance.