ソースコード
var dte = ServiceProvider.GetService( typeof( _DTE ) ) as _DTE; if ( dte == null ) return; var activeDocument = dte.ActiveDocument; if ( activeDocument == null ) return; var textDocument = activeDocument.Object() as TextDocument; if ( textDocument == null ) return; var text = textDocument .CreateEditPoint( textDocument.StartPoint ) .GetText( textDocument.EndPoint ) ;