Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-05-2019, 04:59 AM
Keybraker Keybraker is offline How can I replace FormFields with text Windows 7 64bit How can I replace FormFields with text Office 2013
Novice
How can I replace FormFields with text
 
Join Date: May 2019
Posts: 1
Keybraker is on a distinguished road
Default How can I replace FormFields with text

I want to replace every ActiveDocument.FormFields with text, but everything I try is not working .

I am currently looping though ActiveDocument.FormFields.Count and if it is a checkboox I want it to replace the checkbox with the value in text - "0" or "1".




Code:
Sub Test()

    Dim strCheckBoxSlct As String
    Dim strCheckBoxName As String
    Dim strCheckBoxValue As String
    
    For i = 1 To ActiveDocument.FormFields.Count
        If ActiveDocument.FormFields(i).CheckBox Then
        
            strCheckBoxName = ActiveDocument.FormFields(i).Name
            strCheckBoxValue = ActiveDocument.FormFields(i).CheckBox.Value
            strCheckBoxSlct = ActiveDocument.FormFields(i).Range
            
            'ActiveDocument.FormFields(i).Delete
               
            If strCheckBoxValue = True Then
                ' write 0
            Else
                ' write 1
            End If
            
        End If
    Next
    
End Sub
Reply With Quote
 

Tags
checkbox, formfields



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue Using FormFields.Result boCash Word VBA 0 04-04-2017 12:54 PM
Updating/Locking FormFields Maskot Word VBA 4 06-24-2015 04:40 AM
Macro to find coloured text and replace with form-field/formtext containing that text tarktran Word VBA 1 11-26-2014 08:12 AM
How can I replace FormFields with text Mailmerge and Formfields Liosis Mail Merge 4 03-07-2014 12:56 PM
Renaming Word Formfields: string too long error silverspr Word VBA 7 01-22-2013 06:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:38 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