BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TOLEContainer and Office - problem accessing Toolbar buttons

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
lurkio
Guest





PostPosted: Thu Aug 17, 2006 9:26 pm    Post subject: TOLEContainer and Office - problem accessing Toolbar buttons Reply with quote



Hello everyone,

I am having problems getting access to the toolbar buttons within
Word or Excel documents embedded within my TOleContainer - I can
find the button I want okay but I can't do anything with it!

What I'm trying to do is find a way to get the Office clipboard
cleared but from what I understand there is no simple direct
method of API access to that. My initial approach around this
was to simply iterate through my Word/Excel application object's
appropriate "Clipboard" CommandBarControls collection, find the
specific "Clear Clipboard" control and then call it's Execute
method. Unfortunately, this fails with the rather unhelpful
message "Unspecified Error". After much Googling(TM) I didn't
find any further help on that specific problem and so thought
that I would try out a different approach.

My next attempt was via the Microsoft Active Accessibility API.
After much effort, I managed to retrieve the correct IAccessible
interface for the desired "Clear Clipboard" button but unfortunately
I get that same horrible "Unspecified Error" message as before when
I attempt to call the accDoDefaultAction method. The funny thing is
that when I apply the same technique in a test application against
a separate running instance of Word or Excel (as opposed to the
embedded one in the TOleContainer) it works just fine and gives the
desired result of "pressing" the button and clearing the Office
clipboard. This leads me to conclude that the problem must be to
do with the Office application being embedded in the TOleContainer
getting in the way somehow.

Has anyone else out there came across similar problems - and fixed
them, fingers crossed ?

Thanks in advance,

Lurkio
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.