Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting objIE window to max height 1

Status
Not open for further replies.

JPJeffery

Technical User
May 26, 2006
600
GB
Hi folks

I've been trying to find out of there's a way to set an Internet Explorer window to match the maximum height of the current desktop display (without first finding out the current display settings).

I want the width to be constant but I'd like the height to initially be the maximum available but allow the user to change it afterwards if they like.

So currently I have
Code:
Sub OpenHTMLReport(strReport)
    objIE.visible = true
    objIE.ToolBar = 0
    objIE.statusbar=false
    objIE.Navigate "about:blank"

    Do Until objIE.ReadyState = 4
        WScript.Sleep 100
    Loop

    objIE.Navigate "file:///" & strReportFile

    Do While objIE.Busy = True
        WScript.Sleep 500
    Loop

    do while objIE.Document is nothing
        wscript.sleep 50
    loop

    do while objIE.Document.body is nothing
        wscript.sleep 50
    loop
End Sub
I'm aware of [tt]objIE.height=xxx[/tt] but is there something like [tt]objIE.height=maximum[/tt]? I'm guessing, obviously...

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
 
Interesting question...

This link may assist in what you are trying to do.


From above link - Posted by Damski:
Code:
Dim gfx, colours, horiz, vert

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
("Select * From Win32_DisplayConfiguration")

For Each objItem in colItems
gfx = "Name: " & objItem.DeviceName
colours = "Color depth: " & objItem.BitsPerPel
horiz = "Horizontal resolution: " & objItem.PelsWidth
vert = "Vertical resolution: " & [COLOR=green yellow]objItem.PelsHeight[/color]

Next

msgbox gfx & vbcrlf & colours & vbcrlf & horiz & vbcrlf & vert

V/r,

SPC Key
United States Army
 
Well, that'll do. Thanks very much!
:)


JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top