Microsoft.Office.Tools.Word

This namespace contains a set of types that extend and support the Microsoft Word object model



Word-Interop-Host-Document

EventDescription131007
ActivateEvent Y  
BeforeClose Y  
BeforeDoubleClick Y  
BeforePrint Y  
BeforeRightClick Y  
BeforeSave Y  
BindingContextChanged Y  
BuildingBlockInsert (VBA) YYY
CloseEventOccurs when a document is closed. This is raised in situations where a document is not actually going to be closed. The event is fired before the "do you want to save" dialog is displayed. There is also an Application_DocumentBeforeClose event ?Y  
ContentControlAfterAdd (VBA)Occurs after a content control is added to a documentYYY
ContentControlBeforeContentUpdate (VBA) YYY
ContentControlBeforeDelete (VBA) YYY
ContentControlBeforeStoreUpdate (VBA) YYY
ContentControlOnEnter (VBA) YYY
ContentControlOnExit (VBA) YYY
Deactivate Y  
Disposed Y  
MailMergeAfterMerge Y  
MailMergeAfterRecordMerge Y  
MailMergeBeforeMerge Y  
MailMergeBeforeRecordMerge Y  
MailMergeDataSourceLoad Y  
MailMergeWizardSendToCustom Y  
MailMergeWizardStateChange Y  
New (VBA)Occurs when a new document based on the template is created. This will only run when the code is stored in the template.YYY
Open (VBA)Occurs when a document is opened.YYY
SelectionChange Y  
Shutdown Y  
Startup Y  
SyncEventOccurs when the local copy of a document is synchronized with a copy on the server that is part of a document workspace.Y  
WindowSize Y  
XMLAfterInsert (VBA)Occurs when a user adds a new XML element to a document. If more than one element is added to the document at the same time (for example cutting and pasting XML), the event fires for each element that is inserted. See belowYYY
XMLBeforeDelete (VBA)Occurs when a user deletes an XML element from a document. If more than one element is added to the document at the same time (for example when cutting and pasting XML), the event fires for each element that is inserted. See belowYYY


Word-Interop-Host-Document-Bookmark

EventDescription131007
BeforeDoubleClick    
BeforeRightClick    
DeSelected    
Selected    
SelectionChange    

In VBA the only way to detect when a user double clicks a bookmark is to declare an events class module declaring a withevents variable to the application object
Create the event and detect if the range overlaps with the bookmark in question.
In VSTO using the VSTO extensions this is much easier because the bookmark object itself sources the events so you just need to add

MyBookmark.BeforeDoubleClick += new ClickEventHandler(onDoubleClick) 



Creating Dynamically

These can be created dynamically


Microsoft.Office.Tools.Word.Bookmark AddBookmark( 
   Microsoft.Office.Interop.Word.Bookmark bookmark,
   string name);
Public Function AddBookmark (ByVal range As Microsoft.Office.Interop.Word.Range, _ 
                                  ByVal name As String) As Microsoft.Office.Tools.Word.Bookmark

Microsoft.Office.Tools.Word.Bookmark AddBookmark( 
   Microsoft.Office.Interop.Word.Range range,
   string name);



Word-Interop-Host-Document-Content-Control

ControlDescription131007
BuildingBlockGalleryContentControl    
ComboBoxContentControl    
ContentControl    
OLEControl    
DatePickerContentControl    
GroupContentControl    
PictureContentControl    
PlainTextContentControl    
RichTextContentControl    

All the content controls have these common events

EventDescription131007
Added YYY
BindingContextChanged YYY
ContentUpdating YYY
Deleting YYY
Entering YYY
Exiting YYY
StoreUpdating YYY
Validated YYY
Validating YYY


bookmark - addition BindingContextChanged ?



Word-Interop-Host-Document-XMLNode

EventDescription131007
AfterInsert YYY
BeforeDelete YYY
ContextError YYY
ContextLeave YYY
Deselect YYY
Select YYY
ValidationError YYY

These cannot be created dynamically at run-time



Word-Interop-Host-Document-XMLNodes

EventDescription131007
AfterInsert YYY
BeforeDelete YYY
BindingContextChanged    
ContextError YYY
ContextLeave YYY
Deselect YYY
Select YYY
ValidationError YYY


These cannot be created dynamically at run-time



© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext