• Printing highlighted FormFields (WinXP NL / Word2003 NL)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Printing highlighted FormFields (WinXP NL / Word2003 NL)

    Author
    Topic
    #416517

    In our company we have lots of templates with FormFields (FF). With a button on the Forms toolbar you can toggle highlighting of the FFs on the screen. Recently I had a request to have them highlighted in print also. I came up with this little macro:

    Sub HighlightFF()
    'Toggles highlighting of FormFields on/off for printing purposes
    Dim ff As FormField
    Dim hl As Long
        ProtectionOff
        hl = ActiveDocument.FormFields(1).Range.HighlightColorIndex
        If hl = wdNoHighlight Then
            hl = wdGray25
        Else
            hl = wdNoHighlight
        End If
        For Each ff In ActiveDocument.FormFields
            ff.Range.HighlightColorIndex = hl
        Next ff
        ProtectionOn
    End Sub

    I tried this in Word97 too, but it didn’t work flawlessly. It turned out that if the result of a TextInput FF is an empty string, highlighting is not always shown. Don’t want to spent much time finding out why, as we don’t use Word97 much any more.

    Viewing 0 reply threads
    Author
    Replies
    • #932146

      Word 97 had highlighting? I can’t even remember… As an alternative approach, would shading (as in Borders and Shading) be viable?

      • #932200

        Yep, Word97 has highlighting (for FormFields)! smile
        As I said, we don’t use it much anymore. We migrated to Office 2003, so I won’t experiment with shading. Thanks anyway.

    Viewing 0 reply threads
    Reply To: Printing highlighted FormFields (WinXP NL / Word2003 NL)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: