2. wrd.ActiveDocument.Application.Selection.Text:='АБВГД'; produces some weird symbols, or exactly ÐÐÐÐÐ.
You have to use widestring with OLE/COM/ActiveX.
[/quote]
So I did
wrd.ActiveDocument.Application.Selection.Text:= UTF8Decode( #13#10+ 'АБВГД' +#13#10); but it crashes the app.
After that I did
function StrToWidestr (aString: String): WideString;
begin
Result:= UTF8Decode(aString);
end;
and
wrd.ActiveDocument.Application.Selection.Text:= StrToWidestr( #13#10+ 'АБВГД' +#13#10);That way everything is okay, I just wonder if the first way should really cause a crash.
If nobody else files the
.END bug, I will do it these days, I am just not sure if I can describe it properly.
Currently I have a very odd problem with putting images into Word(Error:
not enough storage is available to complete this operation), probably I'll ask here later.
Edit: It occurred that the problems is caused, because I use
GetTempDir, which results in an 8.3 string, and OLE does not understand it. Converting the filename to widestring solved the problem.
As a conclusion, there is something wrong in Jurassic Pork's source:
XL.Workbooks.Open('f:\demo.xls'); should not be used without conversion to widestring.