Wolfgang Schölmberger
Member
Hi everybody,
Win8, 10, OE11.7 & 12.5
Found a small piece of code which I try to translate from C# to ABL.
I came up with this:
but, as the message shows, 'bt' is not valid.
Could anybody please point out what I'm doing wrong.
TIA, Wolf
Win8, 10, OE11.7 & 12.5
Found a small piece of code which I try to translate from C# to ABL.
C#:
var doc = new Microsoft.Office.Interop.Word.Application().Documents.Open(FileName: docxPath, Visible: false, ReadOnly: true);
byte[] bytes = doc.Range().EnhMetaFileBits;
Image page = Image.FromStream(new MemoryStream(bytes));
doc.Close(WdSaveOptions.wdDoNotSaveChanges);
I came up with this:
Code:
DEF VAR chWord AS COM-HANDLE NO-UNDO.
DEF VAR chDocument AS COM-HANDLE NO-UNDO.
DEF VAR bt AS "System.Byte[]".
CREATE "Word.Application" chWord.
chDocument = chWord:Documents:OPEN("C:\Temp\Test.Docx",FALSE,,,,,,,,,,).
bt = CAST(chDocument:Range():EnhMetaFileBits, "System.Byte[]").
MESSAGE VALID-OBJECT(bt) VIEW-AS ALERT-BOX.
but, as the message shows, 'bt' is not valid.
Could anybody please point out what I'm doing wrong.
TIA, Wolf