Results 1 to 3 of 3

Thread: Need to open browser with specific window size - Help :)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2014
    Posts
    2

    Question Need to open browser with specific window size - Help :)

    Hi,

    I am VERY new to vb scripting. My goal was to create a menu with clickable buttons that would open a firefox window and run an imacro script (which is treated like a URL) which basically logs into a site and prefill forms and click buttons.

    Everything works great and now i am looking just to tweak a few things. For starters, the URL that is opened MUST be in a new browser window - which I've managed. However, I would love to be able to open this new browser with a specified window size, and possibly a location on my screen.

    Is this possible?

    Here is a sample of a script when it's button is clicked:

    <script language="VBScript">
    Sub Individual
    CreateObject("WScript.Shell").Run"""C:\Program Files (x86)\Mozilla Firefox\firefox.exe""-new-window imacros://run/XXXXXXX"
    End Sub
    </script>

    I've tried Firefox's command line options for window size, but can't get them to work. Any help is greatly appreciated. Thanks in advance!

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Need to open browser with specific window size - Help :)

    Welcome to VBForums

    Thread moved from the 'VB6 and Earlier' forum to the 'VBScript' forum

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2014
    Posts
    2

    Re: Need to open browser with specific window size - Help :)

    Alright, so a quick alteration that maybe someone can help with. I managed to resize and locate the focused windown with the alt-e command. So, how can I incorporate a 'send keystroke' in my vb script?

    <input type="button" value="Button1" name="run_button" onClick="test"><br>

    <script language="VBScript">
    Sub test
    CreateObject("WScript.Shell").Run"""C:\Program Files (x86)\Mozilla Firefox\firefox.exe""-new-window imacros://run/XXXXXXX"
    End Sub
    </script>


    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
  •  



Click Here to Expand Forum to Full Width