Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6330853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:56:46+00:00 2026-05-24T17:56:46+00:00

Often I use Visual studio to edit standalone files (not in a project). So

  • 0

Often I use Visual studio to edit standalone files (not in a project). So usually I will have like say 6 files opened (3 html files, 1 css file, 2 js files etc)

And the problem is that whenever i close visual studio, I have to locate and re-open all 7 files again (which is a bother really).

Is there a way for us to like save all 7 files in a state file and simply when i open that state file it will open all the 7 files in whatever order I have last saved them as ?

If you have used Notepad++ you will know what I’m talking about, basically when we close Notepad++ and open it the files that were previously opened stay opened, some sort of functionality like this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:56:46+00:00Added an answer on May 24, 2026 at 5:56 pm

    Here’s two Visual Studio macro methods that should do exactly what you need.

    SaveAll() saves all open files and writes a file named status.txt to C: in which all open files are written separated by semicolon (totally independent of project/solution):

    Sub SaveAll()
    
        Dim text As String
        Dim i As Integer
    
        For i = 1 To DTE.Documents.Count
            text += DTE.Documents.Item(i).FullName + ";"
            DTE.Documents.Item(i).Save()
        Next i
    
        My.Computer.FileSystem.WriteAllText("C:\status.txt", text, False)
    
    End Sub
    

    Next time, when you want to open those files, you simply call OpenAll(). It reads the status file, splits the semicolon separated text, and opens all files:

    Sub OpenAll()
        'Open status file
        Dim text As String
        text = My.Computer.FileSystem.ReadAllText("C:\status.txt")
    
        Dim files As String()
        files = text.Split(";")
        Dim file As String
        For Each file In files
            If file.Length > 0 Then DTE.ItemOperations.OpenFile(file)
        Next
    End Sub
    

    It’s easy enough to modify this according to your needs (or even add a file dialogue). Thanks for asking this question, it made me focus on the VS macro IDE again and see how powerful it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio, I often use objects only for RAII purposes. For example: ScopeGuard
I use Vim and Vim plugins for Visual Studio when writing C++. Often, I
Often I'm creating reports in Visual Studio's Crystal Reports and want to have a
I use Visual Studio 2010 for WPF development of desktop apps. I edit my
I often use visual studio 2005 side-by-side with visual studio 2008. Do you remember
I have a large C++ project under VS2008, and use edit & continue quite
I'm using c++ in visual studio express to generate random expression trees for use
I often use Excel with pivot tables based on .cub files for OLAP-type analysis.
I'm using Visual Studio 2003 working on an ASP.NET application. Quite often, just in
It happens more often than not that I have to comment several lines at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.