Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open Browser from VB with No scrolling.

Posted on 2002-03-29
9
Medium Priority
?
985 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Accepted Solution

by:
samopal earned 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

670 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