Short break for a stupid question. In VS2005 I want to write a macro that
writes some static text at the current cusrsor location.
Here is what I have (that doesn't work):
DTE.ActiveDocument.OutputString("Copyright (C) 2000-2007 Joe Bloggs
Software, Inc. All Rights Reserved")
Corrections appreciated.
Thanks!
It should look like:
Sub InsertText()
DTE.UndoContext.Open("Insert Text")
Try
Dim txt As TextSelection
txt = DTE.ActiveDocument.Selection
txt.Insert("Copyright (C) 2000-2007 Joe Bloggs Software,
Inc. All Rights Reserved", _
vsInsertFlags.vsInsertFlagsInsertAtEnd)
txt.SmartFormat()
Catch ex As System.Exception
End Try
DTE.UndoContext.Close()
End Sub
I haven't tested it but it should work. I just modified my macro from
http://www.helixoft.com/blog/archives/14

Signature
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
.NET and ASP .NET code
Andrew Chalk - 05 Feb 2007 00:55 GMT
Thanks!
That worked and I have bookmarked your site as well.
- A
> It should look like:
> Sub InsertText()
[quoted text clipped - 14 lines]
> I haven't tested it but it should work. I just modified my macro from
> http://www.helixoft.com/blog/archives/14