Microsoft.Office.Tools.Word
This namespace contains a set of types that extend and support the Microsoft Word object model
Word-Interop-Host-Document
Event | Description | 13 | 10 | 07 |
ActivateEvent | Y | |||
BeforeClose | Y | |||
BeforeDoubleClick | Y | |||
BeforePrint | Y | |||
BeforeRightClick | Y | |||
BeforeSave | Y | |||
BindingContextChanged | Y | |||
BuildingBlockInsert (VBA) | Y | Y | Y | |
CloseEvent | Occurs 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 document | Y | Y | Y |
ContentControlBeforeContentUpdate (VBA) | Y | Y | Y | |
ContentControlBeforeDelete (VBA) | Y | Y | Y | |
ContentControlBeforeStoreUpdate (VBA) | Y | Y | Y | |
ContentControlOnEnter (VBA) | Y | Y | Y | |
ContentControlOnExit (VBA) | Y | Y | Y | |
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. | Y | Y | Y |
Open (VBA) | Occurs when a document is opened. | Y | Y | Y |
SelectionChange | Y | |||
Shutdown | Y | |||
Startup | Y | |||
SyncEvent | Occurs 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 below | Y | Y | Y |
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 below | Y | Y | Y |
Word-Interop-Host-Document-Bookmark
Event | Description | 13 | 10 | 07 |
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
Control | Description | 13 | 10 | 07 |
BuildingBlockGalleryContentControl | ||||
ComboBoxContentControl | ||||
ContentControl | ||||
OLEControl | ||||
DatePickerContentControl | ||||
GroupContentControl | ||||
PictureContentControl | ||||
PlainTextContentControl | ||||
RichTextContentControl |
All the content controls have these common events
Event | Description | 13 | 10 | 07 |
Added | Y | Y | Y | |
BindingContextChanged | Y | Y | Y | |
ContentUpdating | Y | Y | Y | |
Deleting | Y | Y | Y | |
Entering | Y | Y | Y | |
Exiting | Y | Y | Y | |
StoreUpdating | Y | Y | Y | |
Validated | Y | Y | Y | |
Validating | Y | Y | Y |
bookmark - addition BindingContextChanged ?
Word-Interop-Host-Document-XMLNode
Event | Description | 13 | 10 | 07 |
AfterInsert | Y | Y | Y | |
BeforeDelete | Y | Y | Y | |
ContextError | Y | Y | Y | |
ContextLeave | Y | Y | Y | |
Deselect | Y | Y | Y | |
Select | Y | Y | Y | |
ValidationError | Y | Y | Y |
These cannot be created dynamically at run-time
Word-Interop-Host-Document-XMLNodes
Event | Description | 13 | 10 | 07 |
AfterInsert | Y | Y | Y | |
BeforeDelete | Y | Y | Y | |
BindingContextChanged | ||||
ContextError | Y | Y | Y | |
ContextLeave | Y | Y | Y | |
Deselect | Y | Y | Y | |
Select | Y | Y | Y | |
ValidationError | Y | Y | Y |
These cannot be created dynamically at run-time
Host Items
Host Controls
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext