Hello everybody,
this code doesn't work because currentDocument.Name is readonly:
DTE dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
for (int i = 1; i <= dte.Documents.Count; i++)
{
Document currentDocument = dte.Documents.Item(i);
if (currentDocument.Name == sourceFilename)
{
currentDocument.Name = newSourceFilename; // Readonly.
}
}Is there a "near" way of renaming documents using DTE or should I use another API?
Thank you.