Hallo Community,
Gibt es eine Möglichkeit, Word (nur für diese Instanz) ohne Add Ins zu starten?
Bisher habe ich nur die Möglichkeit gefunden, diese komplett auszuschalten bzw. im Safe Mode zu starten.
Mein Testcode:
//Disable Add Ins & COM Add Ins
var wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };
//const string dir = @"C:\Temp\Template.docx";
//var doc = wordApp.Documents.Open(dir);
foreach (Microsoft.Office.Core.COMAddIn addIn in wordApp.COMAddIns)
{
var addInName = addIn.Description;
addIn.Connect = false;
}
foreach (Microsoft.Office.Interop.Word.AddIn addIn in wordApp.AddIns)
{
var addInName = addIn.Name;
addIn.Application.AddIns.Unload(false);
}
//doc.Close();
wordApp.Quit();
Application.Exit();
Habt Ihr noch eine Idee?
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code
officeApplication.AddIns.Unload(false);
deaktiviert die Add Ins in Word aber komplett und nicht nur für diese Instanz.