#1
|
|||
|
|||
Text/Font Space Parameters
Please forgive my ignorance - first time poster. If I type some text and then select that text, the text is highlighted by a gray selection "box". This is normal. What determines the size and position of this box relative to the actual characters? I assume that the gray space is determined by some qualities of the font or line spacing, but I don't know how to control/modify it. Here's the current application I'm working on that brings up this query: I wanted to print some labels to insert into the spine sleeve of a three-ring binder. I typed out the titles in big letters on standard letter-size paper (landscaped) with the intention to cut them out into the 1" or 1-1/2" widths as required for the binder width. It occurred to me to put the titles into a text box in order to restrain the dimensions appropriately, e.g., 1"X10", and I could also use the box as cut lines. After typing a title (centered vertically and horizontally) into a text box, I selected it and increased the font size to the maximum that the box would hold. At some point the letters were forced out of center and their bottoms were disappearing out of the text box, despite there being plenty of room for the actual letters. It seems that whatever quality defines the selection box was bumping against the top of my text box and forcing the increasingly larger text down and out of it. Someone, please school me on this subject. |
#2
|
||||
|
||||
I think exploring the selection highlight metrics is an exercise in futility.
Better to explore what is controlling the line spacing, paragraph spacing, table cell margins and table row height parameters, each of which could be a factor in what you are seeing. Table rows will normally grow in height to fit the text inside them but you can override that by setting a specific row height. If the line spacing is smaller than the font size then I would expect text to be cut off at the bottom. If you want to post a sample doc, we can tell you exactly why your text is being cut off.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
||||
|
||||
I agree with Andrew that you should be using table cells rather than text boxes.
If you add a single column table to a blank document. Type your titles in the cells and then run the following macro: Code:
Option Explicit Sub FitText() 'Graham Mayor - https://www.gmayor.com - Last updated - 02 Dec 2019 Dim oTable As Table Dim oRng As Range Dim oCell As Cell Set oTable = ActiveDocument.Tables(1) With oTable .Rows.Height = InchesToPoints(1) .TopPadding = InchesToPoints(0) .BottomPadding = InchesToPoints(0.25) .LeftPadding = InchesToPoints(0.08) .RightPadding = InchesToPoints(0.08) .Spacing = 0 .AllowPageBreaks = True .AutoFitBehavior wdAutoFitFixed .AllowAutoFit = False End With For Each oCell In oTable.Range.Cells oCell.VerticalAlignment = wdCellAlignVerticalCenter oCell.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter Set oRng = oCell.Range oRng.End = oRng.End - 1 If Len(oRng) > 1 Then oRng.Font.Size = 72 Do Until oRng.Characters.Last.Information(wdVerticalPositionRelativeToPage) = _ oRng.Characters.First.Information(wdVerticalPositionRelativeToPage) oRng.Font.Size = oRng.Font.Size - 1 DoEvents Loop End If Next oCell lbl_Exit: Set oTable = Nothing Set oCell = Nothing Set oRng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#4
|
|||
|
|||
Look into, also using an Avery label definition.
Mailings > Labels > Options Creating a new document gives you a pre-defined table. You could use the actual label stock if you want or simply cut the paper. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Insufficient memory or disk space. Word can not display the specified font. | hanspeterhorne | Word | 1 | 09-28-2018 06:36 PM |
Need to create document that will auto insert text based on parameters | parisfranco | Word | 13 | 07-25-2017 03:21 PM |
Trendline parameters | Gilles | Excel | 2 | 01-04-2017 08:02 AM |
Monospace font is not monospaced (continue white space) | HoresXB | Word | 5 | 11-20-2014 04:24 AM |
Printer parameters stored where? | Doc_man | Office | 2 | 06-20-2011 12:27 PM |