Problem with the read and write word file
Question

I am facing the problem for word document read and write in extension using the DLL "Microsoft.Office.Interop.Word". 


Error Details:

Win32Error: 5

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)

   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

   at System.Activator.CreateInstance(Type type, Boolean nonPublic)

   at System.Activator.CreateInstance(Type type)


   at Utility.WordToPDF.Convert(String path, String fileName, Object array, String& pdfFileName)

We can't resolve above issues  but found the alternative solution for Word processing the read and write the files.

I used the OpenXML library - DocumentFormat.OpenXml.

refer the below references -

  • using DocumentFormat.OpenXml;
  • using DocumentFormat.OpenXml.Packaging;
  • using DocumentFormat.OpenXml.Wordprocessing;

 You can build your own components.  

Refer the word document utility - https://www.outsystems.com/forge/component-overview/10745/word-document-utility

Regards,

Shahaji



do you use a specific component Shahaji?

Hans Dollen wrote:

do you use a specific component Shahaji?

 "Microsoft.Office.Interop.Word" 

for write document and read document in outsytems using extension

 

mvp_badge
MVP

Hi Shahaji,

I have faced this issue when i was using "Microsoft.Office.Interop.Excel" in my OnPrimises env.

I have follow this steps and and working fine.

see attahced document.


Hope this will help you.

Regards

Rahul

Wehaveappliedbelowstepsinordertofixtheissue.docx

Rahul Sahu wrote:

Hi Shahaji,

I have faced this issue when i was using "Microsoft.Office.Interop.Excel" in my OnPrimises env.

I have follow this steps and and working fine.

see attahced document.


Hope this will help you.

Regards

Rahul

 Thanks Rahul for reply

This is already use in my local server & its worked but i am facing problem on outsytems extension. What is the solution for outsystems ?


 

We can't resolve above issues  but found the alternative solution for Word processing the read and write the files.

I used the OpenXML library - DocumentFormat.OpenXml.

refer the below references -

  • using DocumentFormat.OpenXml;
  • using DocumentFormat.OpenXml.Packaging;
  • using DocumentFormat.OpenXml.Wordprocessing;

 You can build your own components.  

Refer the word document utility - https://www.outsystems.com/forge/component-overview/10745/word-document-utility

Regards,

Shahaji



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.