Maximise IE window created in VB

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Maximise IE window created in VB

Post by Danish_Ken » Fri Oct 21, 2005 6:08 am

Hi guru's :o

How can i get VB to maximize an IE window created in VB. I have tried following with no success.


Function CreateIE
MaxIEObjects = MaxIEObjects + 1
ReDim preserve IE (MaxIEObjects)
Set IE(MaxIEObjects) = CreateObject("InternetExplorer.Application")
IE(MaxIEObjects).Visible=1
CreateIE = MaxIEObjects
DoCmd.Maximize
End Function

VBEval>CreateIE,IE[1]
VBRun>Navigate,%IE[1]%,,http://www.google.com.au



Function CreateIE
MaxIEObjects = MaxIEObjects + 1
ReDim preserve IE (MaxIEObjects)
Set IE(MaxIEObjects) = CreateObject("InternetExplorer.Application")
IE(MaxIEObjects).Visible=1
IE(MaxIEObjects).Maximize
CreateIE = MaxIEObjects
End Function

VBEval>CreateIE,IE[1]
VBRun>Navigate,%IE[1]%,,http://www.google.com.au


Can't see the wood for trees I bet.

Thanks
Ken
Macro Scheduler since Version 5.0 - 21/10/1998

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 21, 2005 7:05 am

Since this method of automating IE doesn't even need to have IE visible I'm not sure why it is important to have it maximised. This method of automating IE works beneath the user interface and works directly with IE's scripting interface.

I don't know of a way to maximise it per se but you can put IE in full screen mode:

Function CreateIE
MaxIEObjects = MaxIEObjects + 1
ReDim preserve IE (MaxIEObjects)
Set IE(MaxIEObjects) = CreateObject("InternetExplorer.Application")
IE(MaxIEObjects).Visible=1
IE(MaxIEObjects).FullScreen = True
CreateIE = MaxIEObjects
End Function
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts