Hi,
I'm developing an Add-In in C# for Word 2007 using VSTO for VS2005.
Part of the excercise is to monitor pictures on disk that have been
linked into a word document as an inlineshapes collection. Once a
picture file is being changed by a picture editor then the Add-In
needs to update the document with the revised image. To that end I've
used the FileSystemWatcher object, set it to monitor fileextensions
and the path with the concerned pictures. In the corresponding
OnChange eventhandler I issue the call
Word.Document doc =
Globals.ThisAddIn.Application.ActiveDocument;
doc.Fields.Update()
There are other properties of the document that also need to change
such as bookmark names. Trying to do that in the OnChange function
generates an error usually along the lines that "the object is locked
for format changes".
Does anyone know how to get around this? For the
FileSystemWatcherObject I have set its SynchronizingObject = this,
i.e. assigned it to the C# Add-In usercontrol.
Many thanks for any suggestions,
Rob