How to determine Text Size In IE?

Using VB.net 2003 Windows forms - How do I determine which setting the user has selected for Text Size in IE. (In the IE Veiw menu where the user has the option to set Text Size to Largest, Larger, Medium,Smaller, Smallest. )

I am using  -   Dim IE As SHDocVw.InternetExplorer to obtain other properties like
IE.height, IE.LocationURL , etc,  can this info be gathered from there also or is there some other indicator I should observe to tell if  the user has changed the size of the text they view  to something other than medium/default?

IE.Document.body.currentStyle.fontsize always returns (small ) no matter the setting????

I found this example on EE  to use with the webbrowser control - can anyone help translate this over to work with IE?

Function GetFontSize(WebCtl As WebBrowser) As String
    Dim vFontSize   As Variant
   
    Call WebCtl.ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DODEFAULT, 0, vFontSize)
    Select Case vFontSize
        Case 0
            GetFontSize = "Smallest"
        Case 1
            GetFontSize = "Smaller"
        Case 2
            GetFontSize = "Medium"
        Case 3
            GetFontSize = "Larger"
        Case 4
            GetFontSize = "Largest"
    End Select
End Function


Help please
gosonicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QueueItCommented:
Based on MS KB#304103 (http://support.microsoft.com/default.aspx?scid=kb;en-us;304103)

The following should work in VS2003 VB.net

        'Get current font size
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Z As Object
        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Nothing, Z)
        MsgBox("The current font size is " & Z)
    End Sub

    Function GetFontSize(ByVal WebCtl As SHDocVw.InternetExplorer) As String
        Dim vFontSize As Object

        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Nothing, vFontSize)
        Select Case vFontSize
            Case 0
                GetFontSize = "Smallest"
            Case 1
                GetFontSize = "Smaller"
            Case 2
                GetFontSize = "Medium"
            Case 3
                GetFontSize = "Larger"
            Case 4
                GetFontSize = "Largest"
        End Select
    End Function

        'Decrease font size
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Z As Object
        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Nothing, Z)
        If Z > 0 Then
            Z = Z - 1
        Else
            Z = 0
        End If
        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Z, Nothing)
    End Sub

        'Increase font size
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim Z As Object
        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Nothing, Z)
        If Z < 4 Then
            Z = Z + 1
        Else
            Z = 4
        End If
        IE.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Z, Nothing)
    End Sub

Let me know if this works for you.
0
QueueItCommented:
You'll need to change 'IE' to reflect the name of your webbrowser or 'SHDocVw.InternetExplorer' object.
This also assumes that your app has a reference to 'Microsoft Internet Controls' (c:\WINDOWS\system32\shdocvw.dll).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gosonicAuthor Commented:
Thanks
0
QueueItCommented:
You welcome.
Thank You.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.