Jump to content
Sign in to follow this  
Sota

Esconder/mostrar texto com checkbox e bookmark (WORD)

Recommended Posts

Sota

Viva,

Tenho o seguinte código para esconder/mostrar partes do texto que queira. No entanto, após esconder um texto e passar para o seguinte, isto é, a uma outra checkbox, a primeira acção vai incidir sobre o texto referente a checkbox anterior anterior.Alguem sabe o que está a causar isto?

Private Sub CheckBox1_click()
Dim Doc As Document
Dim rng As Range
Set Doc = ActiveDocument
Set rng = Doc.Bookmarks("texto1").Range
Select Case CheckBox1.Value
 Case True
		 With rng.Font
			 .Hidden = False
		 End With
 Case False
	 With rng.Font
		 .Hidden = True
	 End With
End Select
End Sub
Private Sub texto4_click()
Dim orange4 As Range
Set orange4 = Activedocument.Bookmarks("texto4").Range
Select Case texto4.Value
Case False
With orange4.Font
 .Hidden = True
End With
Case True
With orange4.Font
 .Hidden = False
End With
End Select
End Sub
Private Sub texto5_Change()
Dim orange5 As Range
Set orange5 = Activedocument.Bookmarks("texto5").Range
Select Case texto5.Value
Case False
With orange5.Font
 .Hidden = True
End With
Case True
With orange5.Font
 .Hidden = False
End With
End Select
End Sub
Private Sub texto6_Change()
Dim orange6 As Range
Set orange6 = Activedocument.Bookmarks("texto6").Range
Select Case texto6.Value
Case False
With orange6.Font
 .Hidden = True
End With
Case True
With orange6.Font
 .Hidden = False
End With
End Select
End Sub

O meu objectivo e é ter um documento que tenha numa determinada secção tenha varia hipoteses de escolha e que só apareçam as que eu pretendo. Se tiverem outra sugestão para fazer isto força.

Obrigado

Edited by Sota

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.