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 / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

macro - how to open/close application file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian - 09 Mar 2005 17:50 GMT
I have just begun to to learn how to write macros in VC++.   For learning
purposes, I would like to implement a macro that accesses all files in a
'test' project and makes a series of changes to these files.  I am able to
identify each file in my project and then open the file.  But I have yet to
figure out how to close the file.  Could someone kindly tell me how to close
a file?  The following BASIC code illustrates my first efforts:

Sub replaceMacro()
   Dim oItems As ProjectItems = DTE.ActiveSolutionProjects(0).ProjectItems
   Dim oI As ProjectItem
   For Each oI In oItems
           Dim oFilename As String = oI.Name()
           oI.Open(vsViewKindPrimary)

           ' close file
           '   the following line fails and generates the error message
           '  "Object reference not set to an instance of an object
           DTE.ActiveDocument.Close(vsSaveChanges.vsSaveChangesYes)
   Next
End Sub

thanks in advance

Ian
Ian - 09 Mar 2005 18:06 GMT
Please disregard this posting as I realize it should have been put in the VB
newsgroup.

Ian

>I have just begun to to learn how to write macros in VC++.   For learning
>purposes, I would like to implement a macro that accesses all files in a
[quoted text clipped - 20 lines]
>
> Ian

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.