Solved

Open Browser from VB with No scrolling.

Posted on 2002-03-29
9
975 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 42
Hide vba in gp 7 104
Spell Check in VB6 13 126
VB6 - Scroll Mouse wheel on Picturebox 13 72
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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