Re-indents or formats the text selection, including the lines the anchor and active ends are on, according to global settings for smart indenting. SmartFormat causes the selection to include the complete lines at the ends.
' Before running this example, open a code document.Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' Select all code in open document.
' Apply smart formatting rules for the language.