store word table object inside db

Add-in Express™ Support Service
That's what is more important than anything else

store word table object inside db
 
Subscribe
Prakash Bhandary




Posts: 4
Joined: 2026-07-30
I have created a table dynamically at runtime inside a Microsoft Word document using Word automation.

The requirement is that the user should be able to edit the table directly in Word, including modifying existing content, adding new content, adding or deleting rows/columns, and making other changes within the table.

I would like to know the best approach to store the complete table object, along with all the changes made by the user, in the database.

The main requirement is that, when the user opens the document again, I should be able to retrieve the saved data from the database and reconstruct the table in Word exactly as it was previously saved, including the user's edits and formatting.

Could you please suggest the recommended approach for:

Capturing the runtime-created Word table after the user has edited it.
Storing the table content and structure in the database.
Preserving formatting, merged cells, row/column changes, etc.
Loading the saved table later and recreating it in Word.
If possible, maintaining different versions or an audit history of the user's changes.

I would greatly appreciate your guidance on the best way to implement this using Word automation/Add-in Express.
Posted 09 Aug, 2026 06:56:16 Top
Andrei Smolin


Add-in Express team


Posts: 19232
Joined: 2006-05-11
Hello Prakash,

You would need to invent such a system yourself. To detect changes on the fly, you should use the Commandbars.OnUpdate event; in Add-in Express this event is mapped to the CommandBarsUpdate event of every ADX*AppEvents (e.g. ADXWordAppEvents) component; find an example of using that event at https://www.add-in-express.com/creating-addins-blog/excel-shapes-events/. Note that Office may trigger this event really often and non-effective code may cause performance issues. I believe that analyzing the selection and the Undo list (check https://www.add-in-express.com/forum/read.php?FID=5&TID=13077) in the CommandBarsUpdate event may help you to achieve your goals. Make sure you release COM objects as leaving them unreleased may introduce serious, sometimes non-reproducible issues that may be hard to find; check section Best practices and time-saving tips; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Aug, 2026 08:30:59 Top