Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Font in Application.Statusbar (2000+)

    The attached Zipped Doc contains a utility function which is used to generate a status string on Word's Statusbar.
    Sadly the font (in my status bar) is Times new Roman, I suspect; variable, at any rate.

    A variable font means that as my "-" characters are replaced with "+" characters, the string stretches away to the right.

    Is there any (known) way of changing the font in the Status Bar?
    Programmatically from Word/VBA would be ideal.


    <pre>Public Function strComplete(lngSpot As Long, _
    Optional lngLow As Long = 1, _
    Optional lngHigh As Long = 100, _
    Optional lngLength As Long = 100, _
    Optional strDone As String = "+", _
    Optional strToDo As String = "-") As String
    Dim strResult As String
    strResult = String$(lngLength * lngSpot / (lngHigh - lngLow), strDone)
    If lngLength - Len(strResult) > 0 Then
    strResult = strResult & String$(lngLength - Len(strResult), strToDo)
    Else
    End If
    strComplete = strResult
    End Function</pre>

    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Font in Application.Statusbar (2000+)

    No. There is no way you can change the status bar font.

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Font in Application.Statusbar (2000+)

    You can't change the font of the statusbar, but you can hijack that area for your own purposes using a LOT of API functions.
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font in Application.Statusbar (2000+)

    >No. There is no way you can change the status bar font.
    Darn. Thanks. But not necessarily in that order.
    Now to collect sets of equal-width variable-width characters .......
    The attached macro spits out a Debug.print which can be sorted in a table.
    The resultant table is shown in the body of the document.
    This suggests that "[" and "]", both of 22.75pts are good candidates, as would be "[" with any one of "!:;" etc.

    <pre>Public Function ReportWidths(tbl As Table)
    Dim cl As Cell
    For Each cl In tbl.Rows(1).Cells
    Debug.Print Left$(cl.Range.Text, 1) & vbTab & cl.Width
    Next cl
    'Sub TESTReportWidths()
    ' Call ReportWidths(ThisDocument.Tables(1))
    'End Sub
    End Function</pre>

    Attached Files Attached Files

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font in Application.Statusbar (2000+)

    >hijack that area for your own purposes using a LOT of API functions.
    Thanks.
    Any links?
    Please.
    A quick Google search for hijack status bar api returns a slew of data about hijacked sites.

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Font in Application.Statusbar (2000+)

    I can't remember exactly where I got this code from but if you Google the authors mentioned, you may find out! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Attached Files Attached Files
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font in Application.Statusbar (2000+)

    >but if you Google the authors mentioned,

    I had to re-read this entire thread three times until I caught sight of your attachment, for which much thanks.

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Font in Application.Statusbar (2000+)

    before you get too excited, I have to add I have no idea if it works in Word! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font in Application.Statusbar (2000+)

    >I have no idea if it works in Word!

    It will, Rory; it will.
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •