Netoffice progid not found - c#

I've done find and replace solution in Micorsoft.Office.Interop.Word in asp.net I would like to move this solution on NetOffice in my asp.net server where there is no Microsoft Word. I got error
progid not found
. What I do wrong because on my computer where I have Microsoft Word this code work fine in NetOffice?
Word.Application wordApp = new Word.Application(); <-- here is this error

NetOffice is just a COM Wrapper to the office applications, therefore it requires that you have the office app installed on the machine where your application is running.
i.e. You need to have Microsoft Word installed on any machine that you intend to run an app that uses NetOffice.Word.
If this was a desktop app, all you would have to do, would be to install Word on the machine, but given you want to use office automation from a server, and Microsoft does not recommend it, you should look into other options of interfacing with Word documents directly via OpenXML without having to install Word on the machine.
I'd recommend taking a look at the DocX library:
https://github.com/WordDocX/DocX
As well as the articles below:
How to: Create a word processing document by providing a file name (Open XML SDK)
Edit Word Documents using OpenXML and C# Without Automation/Interop

Your code should work with NetOffice, but you need to add a using statement:
using Word = NetOffice.WordApi;
You also need to disable the setting Embed Interop types for all NetOffice DLL's.

Related

How to print DOCX/PDF documents unattended?

I am trying to replace an outdated solution which uses Office Interop to create and print Word documents, and export them to PDF. It needs to run unattended on a server, so we want to get rid of our dependency on Interop. I can create the files fine with Open XML SDK but cannot print or export. Is there some way to do this with libraries (free or paid) that does not require having Adobe/MS Office products installed in a server environment? The limits we have to work within will allow me to either use a .NET console application or a PowerShell script.

How to create Word document in WinRT

I'm currently developing application using WinRT/C#. It is second version, first was developed on WPF. In application I need to generate some reports and export them into MS Word document.
In first version of application I used MS Office Interop to export reports in MS Word, but in WinRT there is no support of MS Office Interop. Is there any simple way to create MS Word document in WinRT? (I know there are third party libraries like Syncfusion for WinRT but I would prefer to not use them).
You won't be able to use MS Office interop from a Windows Store app. You could use Open XML SDK, though. It is also available on NuGet and seems to be WinRT compatible.
Using it won't be as easy as working with interop classes and you'll only be able to create XML based docx files, not binary doc files. On the other hand your users won't need to have Word installed and they'll be able to open the files in other Office suites like OpenOffice or LibreOffice. There's a set of tutorials available on MSDN to get you started.
There is a free solution that consiste to format your document in rtf.
For this i create a new librairy to help a developper to create a document compatible with word.
you can find this there : https://github.com/crogun/WinRTF-For-WinRT
the code is open source, and you can extend it if you want.

Microsoft.Office.Interop

I am using Microsoft.Office.Interop.Word.dll to create docx file. It works on my local machine, but can you tell me how to use it on server without installing MS-Office or any third party packages? Please suggest to me some third party tool.
Unfortunately, You have to have MS Office on machine that should run application. Other solution for example via XML:
Link
Its much better to use xml access to word documents, especilly on servers. When using iterop services, it creates mess on server - need to install office, then the COM objects are not disposing themselves...
check this: Open XML SDK, use DocumentFormat.OpenXml.dll

Using Office 2007 PIA's against OpenOffice.Org

I have been using Office 2007 PIA's to run PowerPoint files in my C# application.
I know that this requires Office 2007 to be installed on the machine.
I wanted to know, can the same set up be run with OpenOffice.org installed instead of Microsoft Office?
Note: I am using a Qindows machine.
While OpenOffice does have an Automation Bridge which allows you to access OpenOffice applications in Automation (a proper subset of COM which in turn you can access through COM Interop), the API profile is most definitely not the same.
That being said, any code that you write which uses the Office 2007 PIAs will not be compatable with the Automation model provided by OpenOffice.
Granted, you can probably do many of the same things that you could do in Office, it's just the way you would go about doing them (the methods you call) would be completely different.
In a word, No.
The PIAs contain mapping information specific to the DLL that they wrap, in your case MS Office application DLLs.

using ms office com objects in other systems without have office installed

i wrote a app for reading excel files.i had to add some references to Microsoft office Com Objects.
it worked good in my system,but when i wanted to use it in other system in which does`t had ms office installed ,
i encounter a problem.i also carried dll files that has been added to project . what should i do ?
In order to use the relevant object libraries you'll have to make sure that Office (Excel in your case) is installed on your client machine. If you have the option I'd suggest to switch to the Open Office XML format anyways. I recently had a similar problem with MS Word and the +work to switch to the new format has def. payed of.
Check MS Open XML SDK
Performace++ and not depending on Office installed...
The Office COM objects depend on Office. You should either arrange for Office to be installed on the other systems, or use a component for reading Excel files that doesn't need Excel installed, such as the ODBC Excel driver or a third-party Excel file reader.

Categories