Solved

Open Browser from VB with No scrolling.

Posted on 2002-03-29
9
974 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

810 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