Results 1 to 9 of 9

Thread: System SaveAs Dialog Box

Threaded View

  1. #9
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: System SaveAs Dialog Box

    you can use sendkey... sendkeys doesnt work on my windows so i added a function to it called SendKey
    Code:
    Option Explicit
    
    
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Private Const SW_MAXIMIZE As Long = 3
    
    Private IE As Object
    
    
    Private Sub Command1_Click()
    Set IE = CreateObject("InternetExplorer.Application")
    
    With IE
       .Visible = True
       .Navigate "www.google.com"
       .Silent = True
    End With
    
    Sleep 1000
    ShowWindow IE.hwnd, SW_MAXIMIZE
    Sleep 200
    SendKey "^{j}"
    Sleep 200
    SendKey "{TAB}"
    SendKey "%{o}"
    Sleep 200
    SendKey "{TAB}"
    SendKey "{TAB}"
    SendKey "{TAB}"
    SendKey "{TAB}"
    SendKey "{TAB}"
    Sleep 200
    SendKey "{ENTER}"
    Sleep 200
    SendKey "{E}{:}{\}{A}{l}{l}{ }{P}{r}{o}{j}{e}{c}{t}{s}{\}{V}{B}{ }{P}{r}{o}{j}{e}{c}{t}{s}"
    SendKey "{ENTER}"
    Sleep 200
    SendKey "{TAB}"
    Sleep 200
    SendKey "{ENTER}"
    Sleep 200
    SendKey "{TAB}"
    SendKey "{TAB}"
    SendKey "{ENTER}"
    Sleep 200
    SendKey "{TAB}"
    SendKey "{TAB}"
    SendKey "{ENTER}"
    End Sub
    
    Private Function SendKey(sKey As String)
    Dim WshShell As Object
     Set WshShell = CreateObject("WScript.Shell")
      WshShell.SendKeys sKey
    End Function
    Last edited by Max187Boucher; Jul 21st, 2012 at 05:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width