![]() |
|
|
|
#1
|
||||
|
||||
|
You could use a pair of on-entry and on-exit macros such as:
Code:
Sub FldExit()
Application.ScreenUpdating = False
Dim sTxtWdth As Single, sFldWdth As Single, sPrnWdth As Single
sFldWdth = InchesToPoints(2.5)
With ActiveDocument.FormFields(1).Range
With .Sections(1).PageSetup
sPrnWdth = .PageWidth - .LeftMargin - .RightMargin - .Gutter
End With
sTxtWdth = .Characters.Last.Previous.Information(wdHorizontalPositionRelativeToPage)
sTxtWdth = sTxtWdth - .Characters.First.Information(wdHorizontalPositionRelativeToPage)
Do While .Characters.Last.Previous.Information(wdVerticalPositionRelativeToPage) <> _
.Characters.First.Information(wdVerticalPositionRelativeToPage)
.Font.Scaling = sFldWdth / (sTxtWdth + sPrnWdth) * 100
Loop
If sTxtWdth > sFldWdth Then .Font.Scaling = sFldWdth / sTxtWdth * 100
End With
Application.ScreenUpdating = True
End Sub
Sub FldEntry()
ActiveDocument.FormFields(1).Range.Font.Scaling = 100
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Don't clear form fields when protecting as a form
|
BruceM | Word | 5 | 10-06-2016 08:26 AM |
| Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
Unable to format fields
|
pro3carp3 | Word | 1 | 03-04-2014 02:49 PM |
Form Fields - Create blank form text field with if statement?
|
LAssist2011 | Word | 5 | 12-14-2011 03:02 PM |
| Form Fields | questions | Word | 0 | 04-27-2009 10:48 AM |