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 / February 2006

Tip: Looking for answers? Try searching our database.

auto change font szie to make content fit the cell in word table?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JerryLee80 - 22 Feb 2006 12:47 GMT
I have a fixed size cell in word table, so i should program to automatically
change font size of contents in that cell, but how?
I have tried to find some helpful infomation , but nothing i found. Anyone
can help me?
Doug Robbins - Word MVP - 22 Feb 2006 20:38 GMT
Use the following:

Dim flag As Boolean, arange As Range, i, j, k

Set arange = Selection.Cells(1).Range
k = arange.Font.Size
flag = False
Do While flag = False
   arange.End = arange.End - 1
   arange.Select
   i = arange.Information(wdVerticalPositionRelativeToPage)
   arange.Collapse wdCollapseEnd
   j = arange.Information(wdVerticalPositionRelativeToPage)
   If j > i Then
       Set arange = Selection.Cells(1).Range
       arange.Font.Size = k - 0.5
       k = arange.Font.Size
   Else
       flag = True
   End If
Loop

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a fixed size cell in word table, so i should program to
>automatically
> change font size of contents in that cell, but how?
> I have tried to find some helpful infomation , but nothing i found. Anyone
> can help me?
 
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.