using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.SourceSafe.Interop; //Add references
using Excel = Microsoft.Office.Interop.Excel; //Add reference
namespace vss
{
class Program
{
private static Excel.Workbook MyBook = null;
private static Excel.Application MyApp = null;
private static Excel.Worksheet MySheet = null;
public static int index = 2;
public static Excel.Application myApp;
static void Main(string[] args)
{
// Create a VSSDatabase object.
VSSDatabase vssDatabase = new VSSDatabase();
//Replace '<>' with your values
// Open a VSS database using network name for automatic user login.
vssDatabase.Open(@"<VSS_DBPAth>", "<username>", "<password>");
// vssFolder represents a SourceSafe project
IVSSItem vssFolder = vssDatabase.get_VSSItem("$/", false);
IVSSItems items = vssFolder.get_Items(false);
MyApp = new Excel.Application();
MyApp.Visible = false;
MyBook = MyApp.Workbooks.Open(@"<Excel_Path>");
MySheet = (Excel.Worksheet)MyBook.Sheets[1];
GetItems(vssFolder);
MyApp.Quit();
Console.Read();
}
static void GetItems(IVSSItem folder)
{
IVSSItems items = folder.get_Items(false);
foreach (IVSSItem item in items)
{
if (item.Type == 0)
{
WriteInExcel(item.Spec);
//Console.WriteLine(item.Spec);
GetItems(item);
}
}
}
static void WriteInExcel(string path)
{
MySheet.Cells[index++, 2] = path;
MyBook.Save();
}
}
}I required all paths from Visual source safe. Just wrote a code to do that.