SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Using OLE CommonDialog box in Robot. Focus??

    I wrote a little function to create a Open file dialog but I think due to the way robot sets itself to minimized when it runs, it is opening the dialog in the background.

    Is there a way to set the focus back to the foreground so people see it when they run the script?

    <font class="small">Code:</font><hr /><pre>
    Function DlgOpenFile () as Variant
    Dim cdg as object
    Set cdg = CreateObject("msComDlg.CommonDialog")
    with cdg
    .DialogTitle = "Select Input script file"
    .MaxFileSize = 32000
    .Filter = "xls files (*.xls)|*.xls"
    .FilterIndex = 1
    .CancelError = True
    .showopen
    DlgOpenFile = .FileName
    end with
    end Function
    </pre><hr />

    <font class="small">Code:</font><hr /><pre>
    'Shows Open File Dialog for user to select DDI file.
    FileName = DlgOpenFile
    If FileName = "" then
    exit sub
    End if
    </pre><hr />

  2. #2
    Advanced Member Ciege's Avatar
    Join Date
    Feb 2002
    Location
    Scottsdale, AZ, USA
    Posts
    594
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using OLE CommonDialog box in Robot. Focus??

    I just ran that and Robot went to minimized and the dialog was displayed.
    Do you mean that if other windows are present then the dialog appears behind those windows? If so you can do a minimize all before starting this dialog then restore your windows that you want after.
    If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

    Ciege...

  3. #3
    Advanced Member RKY's Avatar
    Join Date
    Aug 2006
    Location
    Hyderabad, India
    Posts
    586
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using OLE CommonDialog box in Robot. Focus??


    Here is an simple example to minimize all windows befoew shown the fiel dialog

    <font class="small">Code:</font><hr /><pre>
    Function ShowFileOpenDialog()
    Dim oShell,oDialog
    Set oShell = CreateObject("Shell.Application")
    Set oDialog = CreateObject("UserAccounts.CommonDialog")
    oShell.MinimizeAll
    oDialog.Filter = "xls Files|*.xls"
    oDialog.FilterIndex = 1
    oDialog.InitialDir = "C:\"
    oDialog.ShowOpen
    sFileName = oDialog.FileName
    If Trim(sFileName) &lt;&gt; "" Then
    ShowFileOpenDialog = sFileName
    End If
    Set oShell = Nothing
    Set oDialog = Nothing
    End Function
    </pre><hr />

  4. #4
    Member
    Join Date
    Jan 2004
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using OLE CommonDialog box in Robot. Focus??

    That'll work! Thanks!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:32 AM.

Copyright BetaSoft Inc.