Author |
Topic |
|
rezahasi1
Bangladesh
Posts |
Posted - 08/10/2005 : 07:06:53 AM
|
Origin Version : 7.5 SR5 Operating System:WinXP
For worksheet, I tried below invoke(originObj, 'Execute', '%z=""; doc -e w {%z= %h};');strGraphNames = invoke(originObj, 'LTStr', '%z')
But it always gives the recently created worksheet name. It appears that it always give the worksheet name created most recently, NOT the active one.
Any advice would be suggested Thanks REZA
|
|
Mike Buess
USA
3037 Posts |
Posted - 08/10/2005 : 08:51:43 AM
|
The LabTalk string variable %H always holds the name of the active window. Use this in OriginC...
string sName = Project.Pages().GetName();
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 08/10/2005 08:57:55 AM |
|
|
rezahasi1
Bangladesh
Posts |
Posted - 08/10/2005 : 09:15:05 AM
|
Thanks, but interestingly %H doest not do that AT LEAST in my case. I had to use origin as actxserver. I can get all window names but not the CURRENT ONE ONLY which are selected by mouse or on top.
Possibly, I can't use GetName property when in actxserver, right? thanks anyway |
|
|
Mike Buess
USA
3037 Posts |
Posted - 08/10/2005 : 10:28:21 AM
|
quote: interestingly %H doest not do that AT LEAST in my case.
That's odd, because it obviously worked in your original script - doc -e W {%Z=%H} - which is the usual LT method for finding the name of the most recently created window. I've never used ActiveX, but I would guess that the script could be modified like this...
strGraphNames = invoke(originObj, 'LTStr', '%h')
Mike Buess Origin WebRing Member |
|
|
rezahasi1
Bangladesh
Posts |
Posted - 08/10/2005 : 11:52:11 PM
|
Hi Mr Buess, As you suggested, strGraphNames = invoke(originObj, 'LTStr', '%h'), this one works giving the top most selected window title. It almost serves my purpose, since it collects any window (Worksheet, graph, matrix whatever). I actually wanted to get the top most worksheet only.
Thank you very much for the kind help.
REZA |
|
|
Mike Buess
USA
3037 Posts |
Posted - 08/11/2005 : 08:14:40 AM
|
Hi REZA,
The concept of the "top most worksheet" window has no meaning. There is only one active window which, as you say, can be wks, graph, matrix or layout. You can find out what type of window it is with the exist() function.
if( exist(%H,2) ) ty "%H is a wks window"; else ty "%H is not a wks window";
Mike Buess Origin WebRing Member |
|
|
rezahasi1
Bangladesh
Posts |
Posted - 08/14/2005 : 11:13:20 PM
|
Great!, Thank you very much |
|
|
|
Topic |
|