Tag Archives: wordwriter

Error: WordWriter.dll was loaded by the DLLRegisterServer entry point was not found

Problem

When attempting to register WordWriter.dll with regsvr32, the following error is thrown:

C:\Program Files\SoftArtisans\WordWriter\WordWriter.dll was loaded, but the DLLRegisterServer entry point was not found. DLLRegisterServer may not be exported, or a corrupt version of C:\Program Files\SoftArtisans\WordWriter\WordWriter.dll may be in memory. Consider using PView to detect and remove it.”

Solution

Regsvr32 can be used to register COM objects, but not .NET ones. Because WordWriter is a pure .NET assembly, it does not need to be registered. To be used in a .NET application, WordWriter.dll can be placed in either the Global Assembly Cache (GAC) or in the application’s bin directory.

WordWriter can be used from standard ASP by registering its COM-callable wrapper, WordWriterCOM.dll. The COM wrapper is registered with regsvr32. For more information on using WordWriter in ASP, see the WordWriter documentation on Using WordWriter in ASP.

Files generated by OfficeWriter do not open in the browser

Problem

When OpenInBrowser in the Save method is set to true, the Excel spreadsheet or Word document does not open in the Internet Explorer Browser window as expected. Instead, the spreadsheet opens in Excel or the document opens in Word.

Solution

Using a browser other than Internet Explorer

The plugin that is used to display Office files in the browser is only available in Internet Explorer, so other browsers cannot display Excel or Word files within the browser. However, you can set whether you want to always open the files in Excel or Word, or save them to disk by default.

Firefox:

When a user is sent an Excel or Word file, a dialog box prompting to Open or Save the file pops up. The user can choose an option and then check the “Do this automatically for files like this from now on” box to have it remember this choice.

Chrome:

Chrome defaults to saving the file to disk. If you want to open a file type automatically in Excel or Word, download a file of that type. Once the file is downloaded, right-click the file in the download bar at the bottom of the browser. Select “Always open files of this type”.

Using Internet Explorer

It is likely that the “Browse in Same Window” is disabled for the file types (XLS, XLSX, XLSM, DOC, DOCX, DOCM).

Previously, this option was available under Folder Options > File Types > Select a file type > Check Browse in the same Window.

Starting in Windows Vista, this option is no longer exposed and the registry needs to be modified to enable certain file types to open in the browser. This Microsoft Knowledge Base article explains how to enable the behavior by modifying the registry: A new window opens when you try to view a 2007 Microsoft Office program document in Windows Internet Explorer 7 or Internet Explorer 8.

Excel or Word file generated by OfficeWriter opens in protected view (yellow)

Problem

A report generated using ExcelWriter or WordWriter opens and there is a yellow warning banner saying that the file has been opened in Protected View.

Solution

Starting in Office 2010, Microsoft introduced a security feature that scans files before opening them in Excel or Word. If there is something wrong with the file format definition, it will open in Protected Mode with a red warning banner.

One of the common scenarios for opening a file in Protected View is opening the file from an unsafe location, such as the Temporary Internet Files folder. This means that if the file is streamed to an end-user, it will open in protected view.

For more information about Protected View settings in Office 2010, please refer to this Microsoft TechNet article on how to configure Protected View settings in Office 2010.

Using WordWriter to merge Word Documents

Several of our consulting projects have had a similar need: programatically merge multiple Word documents into a single Word file. Using SoftArtisans’ WordWriter, this task is fairly easy. In this article, I’ll show you how. If you’re not a current WordWriter user, you can download a free evaluation and follow along!

When you use WordWriter to merge documents, the page setup of the destination document you are merging into is used for all pages. (This follows the same behavior as Word.) If you create a new document to merge into, you’re resulting document will have default formatting.

If you want to preserve the formatting of each document that you are merging, insert a section break in your final output file before merging each document. You will then need to copy the formatting information from each document to the section you just created. Some types of document formatting that you may want to preserve include: margins; paper size or orientation; page borders; vertical alignment; and number of columns. (Text formatting, such as font, font size, text color are preserved, so you don’t need to manually set these.) Continue reading Using WordWriter to merge Word Documents