Solved

Open Browser from VB with No scrolling.

Posted on 2002-03-29
9
966 Views
Last Modified: 2008-01-16
OK, below is the code to open the window (most of it), everything works fine, EXCEPT.  There does not seem to be a default property to set scrolling = no.

By default you see a vertical scrollbar, I want to get rid of that.

Any ideas would be great, thanks.

Turbosig...

Set x = CreateObject("InternetExplorer.Application")
   
    x.Navigate strURL
    x.AddressBar = False
    x.FullScreen = False
    x.Top = 1
    x.Left = 1
    x.Width = 770
    x.Height = 577
    x.MenuBar = False
    x.RegisterAsBrowser = True
    x.Resizable = False
    x.Silent = False
    x.StatusBar = True
    x.ToolBar = False
    x.Visible = True
    x.Quit
0
Comment
Question by:turbosig
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6905193
you could put a shape control over where the scrollbar would be so that the user wouldn't see it. (kludgy?)
0
 
LVL 2

Author Comment

by:turbosig
ID: 6905253
'********* ADDED *********
well actually the problem is that we need that extra 10px or so of real-estate.  our web page goes EXACTLY to the edge of the browser.

Using window.open, Showmodal, etc. from within a browser window allows you to open the next window without them visible.  This is necessary since out users use a standard 600x800 resolution, font, font size, etc. and our pages fit EXACTLY within that space, therefore we can not have the scrollbar 'cause it takes up space.
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6905378
in your html files: add <body scroll="no">
0
 
LVL 9

Accepted Solution

by:
samopal earned 50 total points
ID: 6905534
Set x = CreateObject("InternetExplorer.Application")
 
   x.AddressBar = False
   x.FullScreen = False
   x.Top = 1
   x.Left = 1
   x.Width = 770
   x.Height = 577
   x.MenuBar = False
   x.Resizable = False
   x.StatusBar = True
   x.ToolBar = False

   x.Navigate strURL

   Do While x.Busy
      DoEvents
   Loop
   x.Document.body.Scroll = "no"
   x.Visible = True


   x.Quit
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 2

Author Comment

by:turbosig
ID: 6905816
bobbit31 you were on the right track, but samopal is more along the lines of what I need.  I am not actually opening a web page.  I am actually pointing to a .exe file that controls a series of web pages, so the attribute can't be set within the page.

Also, samopal , you are on the right track and you will get points, but I did notice that your solution is only good for that "one" page hit.

If I use Window.Open and set scrlling = no, then for every page there is no scroll bar.  With this method, it is only valid for the first page opened, then when I click on a link, presto, it is back.

Well I am leaving for Vacation, be back in 6 days.  I am gonna see if I can get anymore help with this.  It may very well be "impossible".

Thanks,
Turbosig
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6906383
If i understood:

Paste this code in DocumentComplete event of WB1 control:
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.Object) Then
    WB1.Document.body.setAttribute "scroll", "no"
End If
End Sub
Voilà!. say goodbye to scrollbar.
But, it has an awful behaviour: If you refresh the page, scroll bar shows again!.
To avoid this unwanted "error", we have to handle one more event.
Private Sub WB1_DownloadComplete()
  WB1.Document.body.setAttribute "scroll", "no"
End Sub
There is another way too, see the following code:
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.Object) Then
    WB1.Document.body.style.overflow ="hidden"
End If
End Sub
You can implement this with an Internet Explorer Object, just as we have been reading from previous tips. I mean, instead of using wb1 object, declare an object variable (withevents) of type InternetExplorer and put that code inside appropiate event (DocumentComplete).
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6906386
For extensive explanation:
http://www.angelfire.com/realm/vb-shared/index.html

under "Internet Explorer/Web Browser - DOM Tips" link.
cheers
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7637974
Hi turbosig,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: samopal and Richie_Simonetti

turbosig, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7811839
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange


Richie_Simonetti: points for you at:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20480774.html
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now