How to fix error while working with Microsoft.Office.Interop.Word - ms-word

I am writing a simple Winforms app to generate 44 separate letters from a MS Word template. I get data to each letter from a local SQL Server database. While running the generate letters method I get the error shown here randomly. I am using Microsoft.Office.Interop.Word to do this:
The last time you opened x.docx, it caused a serious error. Do you still want to open it?
When I click No the program exits and when clicked Yes it continues. I manually re-enabled the file in Word options - Add-ins, and I have read solutions about registry editing and questions like this.
Why does this happen, and how can I fix this issue?

Related

WOPI corrupting files on edit

I have a WOPI host running in a Blazor server application with all of the .wopitest tests passing for the desired functionality (others skipped).
When I upload a word document, I am able to view the document with no issues. I am also able to edit the document, however when I try and edit the document a second time, I get an error.
The error doesn't appear to be handled and seems to originate in the Office online javascript file.
Error on attempting second edit
Following the error, I am still able to open the document for viewing. It is the same behaviour if I use the 'Editing' button in the Office Online page or directly navigate to the editing page using an edit action url.
Supplementary information:
Using ngrok to debug locally
.NET 6
Using SQLite database for holding file information (including path to file)
Using local folders for storing file contents (e.g. 'data' folder containing all files)
Similar issues with .xslx files beign corrupted upon editing and requiring a 'repair' when opened with Excel. This repair removes cells containing text and indicates that it removes the theme.
Viewing a word document gives the following console errors View document error
The first editing of a word document gives the following console errors Edit document error
I was expecting to be able to repeatedly edit the document.
I tried opening the file in the Desktop version of Word and got the following error Desktop Word recover
Following a recover, the document appears to work as expected in Word (desktop) but still won't open for editing through WOPI.
Turns out it was the way the POST http request body was being saved.
Still not certain what was going wrong but somewhere along the way of writing the stream into a buffer and then saving that to a file corrupted the file.
I suspect the file stream was either truncating or adding a few bytes.
The interesting part being that Office Online was still able to view the file.
This indicates there is some tolerance for malformed files still being served.

Creating PPT with Perl - error 0x8001010a "application is busy"

actually I'm writing a Perl script for creating a powerpoint presentation automatically. The reason for this is, that I need really much Slides with the same look.
So I always copy the first slide and just update the text in the boxes with new text out of a excel file.
ATM it works fine but rly unstable, so sometimes the PP is created successfully and sometimes the creation is interrupted with the error
Win32::OLE<0.1712> error 08001010a: "The message filter indicated that the application is busy" in Method/Propertyget "TextFrame" at [Pfad] line 150
Would be nice if someone could help me to fix that or explain to me where this error comes from

Swift OS X 10.11 Cannot open SQLite3 database after a second app execution

I use pure commands of the sqlite3 library,,, the first time you install the app, a method executes the sqlite3_open() method. It supposes to create the database. It actually creates it in a user folder (desktop folder in the mac os x) as showed in the log screen. After this step, it creates 2 tables and saves some data, and it completes this, with success.
the second time you run the app, it intents to open the database with the same method sqlite3_open(), but it presents the error showed in the image with code number 14.
After that, I made some research and found that the new version of sqlite uses 3 files (.sqlite, .sqlite-wal and .sqlite-shm)... After reading that, I started searching on how to create those 2 additional files at the moment of creating the first file (the .sqlite file)... But I only found that all the tutorials copy those 3 files (previously created) to the references folder on the project, but they don't create it.
Continuing my search, found that there is an option to change the configuration of the sqlite in my app, to prevent using this wal option... I had to execute the command SQLITE_FCNTL_PRAGMA (maybe this is not used like I'm doing).
Please if you need more info that may help solving this issue please just let me know.
image of Class method that opens/creates the Daatabase
Edit: screenshot with the extended errcode resulting on error 14 with no more details.
imglink

Trouble shooting Oracle Form Builder error FRM-10044

I'm trying to create & save a new form using Oracle Form builder however, I get the error FRM-10044: Cannot create file.
The same thing happens when I open and save an existing form (.fmb)
I've check the folder permissions where the form is being save, it has read write access.
I've tried saving it into a differ folder and also tried creating a new folder but it still throws the same error.
I'm able to create and save a word, excel document in the new or existing folders (as mentioned-above) without any issues.
I suspect it could be something to do with the Windows Registry or System Configuration settings because I had recently shutdown/disabled so of the services in the System Configuration (using
msconfig.exe). Unfortunately, I don't remember all the options that were modified.
I've gone through numerous discussion forums, but still no luck.
Any help is appreciated.
Thanks in Advance
I've experienced the same thing. But in my case, i compiled the form on server side. The error appeared because it was remote-controlled by more than 1 person. One of the remote session was possibly locking the file creation. So I logged off the other session and try to use 1 session only when compiling the form. This happens sometimes when we're using an OS with multiuser and multisession capability.

Reactivating COM AddIn with Word Interop

I've written a custom ribbon for word. In my winForms-application I also open a word document with word-Interop to create some texts with word.
When I use normal word documents my ribbon is shown correct but when I open the document in my application then the ribbon is gone.
I found out that it is somehow disabled in the COM-AddIn-Options in Word. When I reactivate it manually it appears.
How can I reactivate it programmatically?
[Update]
For better understanding: I have two solutions.
1) A AddIn for Word which displays a ribbon
2) A winform-application which has a winword-control which loads word in it.
When the second one is started the first one is not available anymore.
To answer your question, it's not possible to programatically re-enable your add-in from the add-in itself. Think about it - it doesn't get loaded, so its code won't get run. So nothing you put in your code will re-enable the addin, because it won't get executed.
The only way would be to create a watchdog process that checks if the COM add-in has been disabled every 10 minutes or so, and re-enables it. You'll need to know where Word stores those settings though.