[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Bring tab to front on Workspace

Posted on 2006-05-24
8
Medium Priority
?
323 Views
Last Modified: 2013-12-18
Hello -

I was wondering if there was any way programatically to bring focus to an open tab on the Workspace.  

Let's say I have a "Projects" database open.  I have it open to a form which contains an embedded view.  This view shows all of my assigned tasks.  Now I get an email with a link to this same form because a new task was assigned to me.  If I forget I have the db open and click the link in the email I would like the open form to come to the forefront.  


Thanks!
0
Comment
Question by:KDrago
8 Comments
 

Author Comment

by:KDrago
ID: 16751023
I should add that we've been able to prevent the database from opening again - catching it in the postopen event, but cannot figure out how to bring the tab containing the open form to the forefront.
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16751062
Hi KDrago,
I think there's no way to do that using Lotus Script or C/C++ API (only backend).

You can try with key press simulations (using Ctrl + Tab to switch tabs of workspace).

Hope this helps,
Marko
0
 
LVL 9

Expert Comment

by:HappyFunBall
ID: 16751076
I didn't realize that was the default behavior in Notes but I just tried it and I see what you mean.  That seems silly to me.

Anyway, I'm pretty sure you'll be able to do this using the EditDocument method in Lotusscript.  See the designer documentation.  There is a parameter called newInstance (R6 and above only) that will tell the code to try to open an existing instance of the document.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:mbonaci
ID: 16751097
KDrago,
I ment you need to switch workspace tabs, not document tabs (but, by mistake, told you correctly what the keyboard shortcut is).


Marko
0
 
LVL 22

Accepted Solution

by:
mbonaci earned 2000 total points
ID: 16751362
KDrago,
code example:
The code works as though Alt + Tab has been pressed (switches to the first window on the right in the Alt+tab order):

Const KEYEVENTF_KEYUP = &H2
Const VK_MENU = &H12
Const VK_TAB = &H9
Declare Sub KeyPress Lib "USER32" Alias "keybd_event" ( Byval V As Integer, Byval S As Integer, Byval F As Integer, Byval E As Integer )

Sub Postopen(Source As Notesuidocument)
    If Source.Document.HasEmbedded Then
        KeyPress VK_MENU, 56, 0, 0
        KeyPress VK_TAB, 15, 0, 0
        KeyPress VK_TAB, 15, KEYEVENTF_KEYUP, 0
        KeyPress VK_MENU, 56, KEYEVENTF_KEYUP, 0
    End If
End Sub

Hope this helps,
Marko
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16751395
KDrago,
and yes, CTRL is &H11

Hope this helps,
Marko
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16752877
Uh, I can be wrong:  >>If I forget I have the db open and click the link in the email I would like the open form to come to the forefront.  
<<  what is formatting the link?  Geeez... let's create LOTS OF CODE instead of fixing the link!!!! :))

If you send a regular link, you can add target="_SELF", etc. to the link if it's a web link.  Normally, these links are constructed for both Notes and WEB

Web side is easy, add a target.

Notes side, well, instead of URL + Notes link, maybe send BUTTON (such a concept) that, as Happy says, doesn't open a new instance.

So, decide in your application how you want the link to arrive.  If you want it to open in the same instance of a window already open, then you're going to have to send both a URL and a button -- one for web, another for client.

make sense?
0
 

Author Comment

by:KDrago
ID: 16902660
I apologize for the delay...just returned to this now.  Thanks for your help!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question