Is a property which can be validated using WdSelectionType enumeration which has following constants:
- wdNoSelection : Its integer value is 0, No Selection
- wdSelectionIP: Its integer value is 1, refers to an inline paragraph selection in a document.
- wdSelectionNormal: Its integer value is 2, refers to normal or user defined selection in a document
- wdSelectionFrame: Its integer value is 3, refers if selection within frame object
- wdSelectionColumn: Its integer value is 4, refers if selection is within a column in a table
- wdSelectionRow: Its integer value is 5, refers if selection is within a row in a able
- wdSelectionBlock: Its integer value is 6, refers to a block selection
- wdSelectionInlineShape: Its integer value is 7, if an inline shape is selected
- wdSelectionShape: Its integer value is 8, if selection is a shape
Public SelectionType 'bind selection Dim oSelection As Selection Set oSelection = Selection 'Perform check Select Case oSelection.Type Case wdSelectionNormal: Debug.Print "Normal selection found" Case wdSelectionIP: Debug.Print "Inline Paragraph selection found" Case wdSelectionFrame: Debug.Print "Frame selection found" Case wdSelectionColumn: Debug.Print "Column selection found" Case wdSelectionRow: Debug.Print "Row selection found" Case wdSelectionBlock: Debug.Print "Block selection found" Case wdSelectionInlineShape: Debug.Print "Inline Shape selection found" Case wdSelectionShape: Debug.Print "Shape selection found" Case Else Debug.Print "No selection found" End Select 'Memory cleanup Set oSelection = Nothing End If
Row selection found
Please leave your comments or queries under comment section also please do subscribe to out blogs to keep your self upto date.