Hello Harry,
You can callDTE.Document.Selection.NewLine() to insert anew lineat the location of the cursor. If you want toformat the codes in the active document, you can call ExecuteCommand function. Codes look like,
------------------------------------------------------------------------
DTE.ActiveDocument.Selection.NewLine()
DTE.ExecuteCommand(
"Edit.FormatDocument")
------------------------------------------------------------------------
"Edit.FormatDocument")
------------------------------------------------------------------------
Hope this helps! Have a nice day.
Ji Zhou
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.