How do I limit the text in a bookmark
From: Lynn Taylor (anonymous_at_discussions.microsoft.com)
Date: 02/25/04
- Next message: Sophia: "Problem withToolTip"
- Previous message: BruceB: "Re: using vba to wrap text around picture"
- In reply to: Jens Thomsen: "How do I limit the text in a bookmark"
- Next in thread: Jens Thomsen: "Re: How do I limit the text in a bookmark"
- Reply: Jens Thomsen: "Re: How do I limit the text in a bookmark"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 08:29:53 -0800
You can use the following vba.
Dim sString As String
Dim iCount As Integer
sString = Selection.text
iCount = Selection.Characters.Count
If iCount > 10 Then
sString = Left(sString, 10)
End If
Selection.TypeText text:=sString
End Sub
Select the text in your bookmark, then run the code. It
counts the amount of characters in your string, and if
there are more than x amount, it just takes the first x
mount from the left and replaces the entire string with
just that amount of characters. You can change the
characters to words if you wish, so it will word.count.
The example above uses 10 characters but you can change
this to what you want.
Hope this is useful.
>-----Original Message-----
>I put a bookmark in a cell in a table.
>The cell has a standard width, can't get any wider.
>
>How do I limit my bookmark to just one line of text?
>Can I detect Cr or something.
>
>All I want is one line of text in my bookmark and thats
it.
>
>Hope you can help me.
>
>Jens, Denmark
>.
>
- Next message: Sophia: "Problem withToolTip"
- Previous message: BruceB: "Re: using vba to wrap text around picture"
- In reply to: Jens Thomsen: "How do I limit the text in a bookmark"
- Next in thread: Jens Thomsen: "Re: How do I limit the text in a bookmark"
- Reply: Jens Thomsen: "Re: How do I limit the text in a bookmark"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|