473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Macro in IDE

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
Nov 21 '05 #1
4 967
Francois,

Why would you do something generic in the design time of your program, when
you can do it at runtime instead. (I know one reason, however that is in my
opinion spending time with nothing).

I am curious what it can be

Cor
Nov 21 '05 #2
Hi,

Change project templates
http://support.microsoft.com/default...b;en-us;555160

DX Core is free framework from developers express for extending visual studio
http://www.devexpress.com/Products/NET/DXCore/

Ken
--------------------------

"Francois Soucy" wrote:
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

Nov 21 '05 #3
I don't know How I could do something like I want in runtime? It make no
sense for me. Ken Tucker show me a good solution.

Francois

"Cor Ligthert" <no************@planet.nl> a écrit dans le message de news:
uv**************@TK2MSFTNGP14.phx.gbl...
Francois,

Why would you do something generic in the design time of your program,
when you can do it at runtime instead. (I know one reason, however that is
in my opinion spending time with nothing).

I am curious what it can be

Cor

Nov 21 '05 #4
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

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Andrew Dalke | last post by:
Here's a proposed Q&A for the FAQ based on a couple recent threads. Appropriate comments appreciated X.Y: Why doesn't Python have macros like in Lisp or Scheme? Before answering that, a...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
2
by: Pete | last post by:
In Access 95/97 I used to be able to create pull down menus (File,Edit ...) from a macro. It seems there used to be some wizard for that. However in Access 2000 it seems you have to build your...
7
by: Newbie_sw2003 | last post by:
Where should I use them? I am giving you my understandings. Please correct me if I am wrong: MACRO: e.g.:#define ref-name 99 The code is substituted by the MACRO ref-name. So no overhead....
3
by: Alexander Ulyanov | last post by:
Hi all. Is it possible to pass the whole blocks of code (possibly including " and ,) as macro parameters? I want to do something like: MACRO(FOO, "Foo", "return "Foobar";", "foo();...
8
by: lasek | last post by:
Hi...in some posts i've read...something about using macro rather then function...but difference ??. Best regards....
12
by: Laurent Deniau | last post by:
I was playing a bit with the preprocessor of gcc (4.1.1). The following macros expand to: #define A(...) __VA_ARGS__ #define B(x,...) __VA_ARGS__ A() -nothing, *no warning* A(x) -x ...
6
by: Takeadoe | last post by:
Dear NG, Can someone assist me with writing the little code that is needed to run an update table query each time the database is opened? From what I've been able to glean from this group, the...
5
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In the function, I'll reading data from the record...
0
by: =?Utf-8?B?TGV0emRvXzF0?= | last post by:
I'd like to create a Macro that will sort some raw data, apprx 20k lines, remove some lines based upon a condition in a certain column. Then copy this data into a new spreadsheet and sort the ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.