Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / August 2005

Tip: Looking for answers? Try searching our database.

Is there a way to run macro automatically for every .CS file in the solution ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 05 Aug 2005 18:11 GMT
Is so, could you please redirect or post me an example ?
Thank you.
Ian - 10 Aug 2005 15:09 GMT
Mi Mark,

I have just started learning how to use/write macros and so cannot tell you
if it is possible to have a macro automatically access each file in your
solution.  You can however, write your own macro to do the same thing.  My
solution contains a single project and the subroutine/macro shown below
illustrates how to list all files in the solution/project files in the IDE
output window.   Hope this helps.

Ian

Sub viewFilesInCurrentProject()
   Dim oProjectItems As ProjectItems =
DTE.ActiveSolutionProjects(0).ProjectItems
   Dim oItem As ProjectItem
   For Each oItem In oProjectItems
         Dim oFilename As String = oItem.Name()
         Debug.WriteLine("file name = " + oFilename)

         Dim oFilePath as String = oItem.Filenames(1)
         Debug.WriteLine("file path= " + oFilename)

         ' call yourSubroutine( oFilename )
   Next
End Sub

> Is so, could you please redirect or post me an example ?
> Thank you.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.