Solved

Open Browser from VB with No scrolling.

Posted on 2002-03-29
9
984 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 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…
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…
Suggested Courses
Course of the Month5 days, 8 hours left to enroll

627 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