Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Tue, 22 Jul 2008 18:40:00 -0700,    group: microsoft.public.publisher.programming        back       


user keystrokes interpretted by publisher   
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
date: Tue, 22 Jul 2008 18:40:00 -0700   author:   bcarsto

RE: user keystrokes interpretted by publisher   
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
date: Fri, 25 Jul 2008 10:39:20 -0700   author:   bcarsto

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us