Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue with TextWidth Function

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
So I'm trying to use the textwidth function to correctly size a column header of my listview control. However, VBA doesn't seem to recognize this command. Is the TextWidth function not available in VBA? I thought it was a standard function for printing.

Code:
Dim objColumnHeader As ColumnHeader
    Dim itmTagName As ListItem
    Dim lvwTags As ListView
    
    Set lvwTags = lvwTagList
    Set objColumnHeader = lvwTags.ColumnHeaders.Add(, , "TagID", [highlight]textwidth("TagID")[/highlight])

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Ahh. This function must only be for Access. I'm using Excel 2007.

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
My code in thread222-1036091 should give you the text width in any VBA host that knows what a Font (well a StdFont) is ...
 
Hey, thanks again guys. You're a great help as always. Unfortunately this project has had to take a major backseat. I'll take a look at it again when I can.

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top