I am automating publisher (2003) within my c++ application. The ffollowing code illustrates how I am opening a pub file are interating through shapes. within this loop, if a user clicks any keys on the keyboard, the keysstrokes are accepted by publisher and actually appear on the resulting publisher document. Publisher::_DocumentPtr Template = m_app->Open(Document, variant_t(true), variant_t(false), Publisher::pbDoNotSaveChanges); Template->ActiveWindow->PutVisible(_variant_t(true)); long lTotPag = Template->Pages->Count; for (long lPag = 1; lPag <= lTotPag; lPag++) { Publisher::PagePtr Page = Template->Pages->GetItem(lPag); Template->ActiveView->PutActivePage(Page); Page = Template->ActiveView->GetActivePage(); iTotShp = Page->Shapes->Count; // perform operations on textbox shapes in the page } Am I doing something wrong here? The publisher document is not visible during my shapes loop, but the users keystrokes are appearing in the finisheed publisher document. Is there a way to prevent this? Has anyone else seen this? thanks Bob
For anyone interested we worked around this problem by using Template.ActiveWindow.WindowState = pbWindowStateMinimize; "bcarsto" wrote: > I am automating publisher (2003) within my c++ application. The ffollowing > code illustrates how I am opening a pub file are interating through shapes. > within this loop, if a user clicks any keys on the keyboard, the keysstrokes > are accepted by publisher and actually appear on the resulting publisher > document. > > Publisher::_DocumentPtr Template = m_app->Open(Document, variant_t(true), > variant_t(false), Publisher::pbDoNotSaveChanges); > Template->ActiveWindow->PutVisible(_variant_t(true)); > > long lTotPag = Template->Pages->Count; > for (long lPag = 1; lPag <= lTotPag; lPag++) > { > Publisher::PagePtr Page = Template->Pages->GetItem(lPag); > Template->ActiveView->PutActivePage(Page); > Page = Template->ActiveView->GetActivePage(); > iTotShp = Page->Shapes->Count; > // perform operations on textbox shapes in the page > } > > Am I doing something wrong here? The publisher document is not visible > during my shapes loop, but the users keystrokes are appearing in the > finisheed publisher document. Is there a way to prevent this? Has anyone else > seen this? > > thanks > Bob