Software Technology Tips

If you are using Visual Basic (VB 6) and need to open new tabs in Internet Explorer (IE 7) from code, here is some sample code that will do the trick.
  
Private Declare Sub VariantChangeType Lib "oleaut32" _
(Destination, Source, ByVal wFlags As Long, ByVal vt As VbVarType)
 
Private Sub Document_New()
    Dim ie As New SHDocVw.InternetExplorer
    ie.Visible = True
    Dim h As Variant
    h = CInt(&H800)
    Call VariantChangeType(h, h, 0, vbLong)
    Call ie.Navigate("
www.mindfiresolutions.com")
    Call ie.Navigate("
www.mindfiremobile.com", h)
End Sub
You could avoid going through hoops for hex-Variant conversion as given above and pass decimal 2048 directly:
 
 Call ie.Navigate("www.mindfiremobile.com", 2048)
 
Try it, see what happens :)


Related Tags:

Visual Basic

Author: Danish Ahmed

Related Pages

  • Windows Desktop Programming
  • Visual Basic Web Projects

SharePoint

Let us Connect!

privacy
iso 9001 QA25 Nasscom Red Herring zinnov STPI iso 27001

copyright (c) Mindfire Solutions 2007-2013. Login