[VBA] Test a special character checkbox
multiboute
-
Fxbrg Posted messages 715 Status Membre -
Fxbrg Posted messages 715 Status Membre -
Hello,
I am programming a bit in Word VBA,
I am looking for a way to test the character once it is selected,
so that in my form I can set the radio button to True or False.
Conversely, I have the code to insert this special character into the Word page:
Sub insererSymbole(signetnom, coche)
'
' insererSymbole Macro to insert a checked or unchecked box after a bookmark
' Macro recorded on 29/02/2008 by 1084417
'
ActiveDocument.Bookmarks(signetnom).Select
If coche = 1 Then
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InsertSymbol CharacterNumber:=-3976, Unicode:=True, Bias:=0
Selection.TypeText Text:=" "
Else
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InsertSymbol CharacterNumber:=-3928, Unicode:=True, Bias:=0
Selection.TypeText Text:=" "
End If
End Sub
this 'character' valued -3976 or -3928 inserts a graphical character empty box or checked box...
but now I want to do the opposite:
I position myself at the bookmark, I select this 'character'...well I know how to do that...
now:
how to test (with a CHR$? I couldn't find the value?) this character so that I can, in the form, set the corresponding button to True (checked) or False (unchecked)?
thank you for your help...
I am programming a bit in Word VBA,
I am looking for a way to test the character once it is selected,
so that in my form I can set the radio button to True or False.
Conversely, I have the code to insert this special character into the Word page:
Sub insererSymbole(signetnom, coche)
'
' insererSymbole Macro to insert a checked or unchecked box after a bookmark
' Macro recorded on 29/02/2008 by 1084417
'
ActiveDocument.Bookmarks(signetnom).Select
If coche = 1 Then
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InsertSymbol CharacterNumber:=-3976, Unicode:=True, Bias:=0
Selection.TypeText Text:=" "
Else
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InsertSymbol CharacterNumber:=-3928, Unicode:=True, Bias:=0
Selection.TypeText Text:=" "
End If
End Sub
this 'character' valued -3976 or -3928 inserts a graphical character empty box or checked box...
but now I want to do the opposite:
I position myself at the bookmark, I select this 'character'...well I know how to do that...
now:
how to test (with a CHR$? I couldn't find the value?) this character so that I can, in the form, set the corresponding button to True (checked) or False (unchecked)?
thank you for your help...
Configuration: Windows XP Internet Explorer 6.0