Thursday, July 01, 2004

Indesign SDK - Front Document

When you want to obtain a pointer to the current front document (the one the user is editing) you could use

InterfacePtr doc(Utils()->GetFrontDocument(), UseDefaultIID());
but when you are inside an action component it may not work, instead you should use
InterfacePtr doc(ac->GetContextDocument(), UseDefaultIID());
where ac is the IActiveContext* passed in the DoAction.

No comments: