4 Replies Latest reply on May 16, 2012 10:42 AM by Daves61

    How to get notification when any master spread is set to active from InDesign

    Daves61 Level 1

      Hi all,

      I need to get notified when any master spread is selected from InDesign or pages are inserted/deleted from any master spread.

      For this, I have implemented a custom observer derived from CObserver.

      In AutoAttach(), the code is as follows,

              InterfacePtr<IWorkspace> docWorkspace(doc->GetDocWorkSpace(), UseDefaultIID());

              if( !docWorkspace )



              InterfacePtr<ISubject> docSubject(docWorkspace, UseDefaultIID());

              if( !docSubject )



              docSubject->AttachObserver(this, IID_ISPREADLIST, IID_IABCDOCOBSERVER);

              docSubject->AttachObserver(this, IID_ICURRENTSPREAD, IID_IABCDOCOBSERVER);

              docSubject->AttachObserver(this, IID_IMASTERSPREADLIST, IID_IABCDOCOBSERVER);

              docSubject->AttachObserver(this, IID_IPAGEPREFERENCES, IID_IABCDOCOBSERVER);


      I have observed these protocols but still don't get any notification when any spread is selected (set to active spread) or pages are added in any master spread.


      Please let me know which interface should be observed to get notified for the same? Am I correct in checking the document workspace as subject?

      Please help me out. Thanks in advance.