W
Word2007VBAer
I've defined a .dotm template with a customized Ribbon. I am linking to Word
from another program via OLE LinkTo, AttachedTemplate, then calling my own
initialization macro on the template, then Activate. This works fine in all
but one odd case, where the custom ribbon does not appear and the
corresponding OnLoad event never fires.
It works if Word is not open when running my program,and thus it gets opened
via the OLE calls. It works if Word is open but has no document open before
running my program. It works if Word has a document open provided that Word
was started by double-clicking the document. But if the user opens Word
directly, and then loads a document (not using my custom template), and then
we execute the programmed link, the new document opens successfully in Word
(with my custom template), but the ribbon does not update to the customized
version (and OnLoad does not fire).
If the user then manually puts focus back on his/her original document, and
then switches back to my document opened under program control, the ribbon
DOES update at that point.
Anyone have a similar experience, and possibly insight into what's wrong or
how to work around it? Thanks!
from another program via OLE LinkTo, AttachedTemplate, then calling my own
initialization macro on the template, then Activate. This works fine in all
but one odd case, where the custom ribbon does not appear and the
corresponding OnLoad event never fires.
It works if Word is not open when running my program,and thus it gets opened
via the OLE calls. It works if Word is open but has no document open before
running my program. It works if Word has a document open provided that Word
was started by double-clicking the document. But if the user opens Word
directly, and then loads a document (not using my custom template), and then
we execute the programmed link, the new document opens successfully in Word
(with my custom template), but the ribbon does not update to the customized
version (and OnLoad does not fire).
If the user then manually puts focus back on his/her original document, and
then switches back to my document opened under program control, the ribbon
DOES update at that point.
Anyone have a similar experience, and possibly insight into what's wrong or
how to work around it? Thanks!