OpenXml in ABL

Posted by thierryk on 20-Mar-2019 09:41


The needs of a project, brought me to use openXMl library. Basically, i'd like to create a new Word Document (docm) in which I inject body and macros from another document.

I'm stuck in this task because of ABL restrictions. ABL doesn't support generic collections and then some .NET methods are not accessible.

Like for example the method that adds a new part to a document.

VbaProjectPart vbaProjectPart1 = mainPart.AddNewPart<VbaProjectPart>("rId9"); // C# code

Is there a workaround in ABL or should I go for an external solution (C# dll) ? 

Best regards.

All Replies

Posted by dbeavon on 20-Mar-2019 12:54

Yes, use an external solution.  In general OpenEdge ABL doesn't do a great job with XML, let alone Office formats.

You could interact with a dll or out-of-process code (via SOAP or REST).

On Windows there is something in OpenEdge ABL called the "CLR bridge" that would allow you to interact with a .Net-framework-appdomain within the same process as your ABL code.  You can even load arbitrary .Net assemblies (eg. one of your creation).  Before using any .Net interface you would want to ensure that the .Net interface is relatively simple (no generics, delegates, events, etc).

This thread is closed