java - OLE: embed microsoft word without add ins -
as described here start word without add ins, possible start ms word without "add ins" or in "safe mode".
wondering if possible in swt application, embedding word using ole?
right following:
new olecontrolsite(clientframe, swt.none, "word.document")
maybe there program id, similar "word.document" forces word start without add ins?
maybe there property or setting accomplishes this?
this code, in eclipse forum, disables add-ins after word loaded:
https://www.eclipse.org/forums/index.php/t/221747/
int idaddins = application.getidsofnames(new string[] {"comaddins"})[0]; variant addinsvar = application.getproperty(idaddins); oleautomation addins = addinsvar.getautomation(); int countid = addins.getidsofnames(new string[] {"count"})[0]; variant countvariant = addins.getproperty(countid); int addinsitemid = addins.getidsofnames(new string[] {"item"})[0]; (int = 1; <= countvariant.getint(); i++) { variant addinsitemvariant = addins.invoke(addinsitemid, new variant[] {new variant(i)}); oleautomation addinsitem = addinsitemvariant.getautomation(); int addinsitemconnectid = addinsitem.getidsofnames(new string[] { "connect" })[0]; if (addinsitem.getproperty(addinsitemconnectid).getboolean()) { int addinsitemnameid = addinsitem.getidsofnames(new string[] { "progid" })[0]; variant addinsitemnamevariant = addinsitem.getproperty(addinsitemnameid); string name = addinsitemnamevariant.getstring(); addinsitem.setproperty(addinsitemconnectid, new variant(false)); } }
warning: disables add-ins outside of application, might want enable after closing application.
Comments
Post a Comment