Hi Francois,
In the Macros IDE, open the EnvironmentEvents and use the
DocumentEvents_DocumentOpened event. You must cast Document to TextDocument,
guess if the document is new or not and if it is new, then use something
like TextDocument.StartPoint.CreateEditPoint.Insert(myh eader)
Another approach is to edit the template used by VS.NET, as described in my
KB article pointed by Ken.
Also, my add-in (below) allows you to do that with a single mouse click or
keystroke, and another feature allows you to verify that each file has a
compliant header.
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Francois Soucy" <Ro**@127.0.0.1> escribió en el mensaje
news:eo**************@TK2MSFTNGP15.phx.gbl...
Hi All,
I would like to know if it's possible to fire a event whenever I
add a new class file to my project? What I want is to automate the process
of adding some region and header comment to each new file that I add to my
project. It's possible? If yes can you give me a direction?
Give you an example:
In the Project Menu I add a class and name it Something.vb
The the "macro event" will add these thing automaticly:
'********************
'Francois
' 50/05/2005
'
'This class do some things
'*********************
Public Class Something
#region "Declaration"
#end region
#region "Methodes"
#end region
....and so on
end class
Thank
Francois
Sorry for my english