Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Height of the text in cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phelicks@gmail.com - 03 Dec 2006 09:10 GMT
Hi folks.
I need to write a macros that reduces size of text in table when it
begin to resize in case of long string of text inserted ?
Jezebel - 03 Dec 2006 10:58 GMT
Yes?

> Hi folks.
> I need to write a macros that reduces size of text in table when it
> begin to resize in case of long string of text inserted ?
Helmut Weber - 03 Dec 2006 11:39 GMT
Hi,

like this, but I wonder, whether it's a good idea,
to reduce font size until the text doesn't occupy
more then the given number of lines.

Sub Test733()
Dim LinesAllowed As Long
LinesAllowed = 2
selection.Cells(1).Range.Text = String(30, "m")
selection.Cells(1).Select
selection.End = selection.End - 1
With selection.Range
  While .ComputeStatistics(wdStatisticLines) > LinesAllowed
     .Font.Size = .Font.Size - 1
  Wend
End With
End Sub

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Phelicks@gmail.com - 03 Dec 2006 14:00 GMT
Thats a good idea !!!

> Hi,
>
[quoted text clipped - 22 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.