Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-08-2016, 02:49 PM
macropod's Avatar
macropod macropod is offline format form fields Windows 7 64bit format form fields Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
format form fields 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
format form fields Unable to format fields pro3carp3 Word 1 03-04-2014 02:49 PM
format form fields 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft