Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2015, 02:34 PM
brent chadwick brent chadwick is offline Retain format in dropdowns when unlinking fields Windows 8 Retain format in dropdowns when unlinking fields Office 2013
Advanced Beginner
Retain format in dropdowns when unlinking fields
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default Retain format in dropdowns when unlinking fields


Hey Guys,
I've looked everywhere for an answer to this one. I have a dropdown form field that I need the text to be italic. However when I unlink the fields it looses the format and returns to regular text. Suggestions? Thanks-
Reply With Quote
  #2  
Old 09-08-2015, 05:24 AM
gmayor's Avatar
gmayor gmayor is offline Retain format in dropdowns when unlinking fields Windows 7 64bit Retain format in dropdowns when unlinking fields Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you describe is the normal behaviour, however you can establish whether the font is italic before unlinking then reapply the italics if required e.g.

Code:
Sub UnlinkFormFields()
Dim oFF As FormField
Dim oRng As Range
Dim i As Long
    If Not ActiveDocument.ProtectionType = wdNoProtection Then
        ActiveDocument.Unprotect Password:=""
    End If
    For Each oFF In ActiveDocument.FormFields
        i = Len(oFF.Result)
        Set oRng = oFF.Range
        If oFF.Range.Font.Italic = True Then
            oRng.Fields.Unlink
            oRng.End = oRng.End + i
            oRng.Font.Italic = True
        Else
            oRng.Fields.Unlink
        End If
    Next oFF
lbl_Exit:
    Set oFF = 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
Reply With Quote
  #3  
Old 09-08-2015, 12:50 PM
brent chadwick brent chadwick is offline Retain format in dropdowns when unlinking fields Windows 8 Retain format in dropdowns when unlinking fields Office 2013
Advanced Beginner
Retain format in dropdowns when unlinking fields
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

Thanks-works great-
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retain format in dropdowns when unlinking fields Retain source format even on combination of multiple documents of different formats G.Anusha Word 12 12-14-2021 03:31 PM
Retain format in dropdowns when unlinking fields retain form fields upon conversion to pdf billy123 Word 1 05-24-2015 07:04 PM
Retain format in dropdowns when unlinking fields Unable to format fields pro3carp3 Word 1 03-04-2014 02:49 PM
3x1 Table: text in fields loses paragraph format when being bulleted madasco Word 3 06-07-2013 06:44 AM
Retain format in dropdowns when unlinking fields Format Fields in Word 2010 Dave013 Word 2 01-11-2013 01:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:18 PM.


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