4 Replies Latest reply: Apr 7, 2011 4:00 PM by rodrigo_acosta RSS

    hide and show tab

    murabza

      Can somebody please tell me how to hide and show a tab using a button click[*-)]

        • hide and show tab

          1. You have to make a button.

          2. Click properties - in function mrak MAcro. I next tab write a macro by editing.

          3. Exmaple o f Macro

           

           

           


          Sub show
          set y = ActiveDocument.Variables("Marketing")
          y.SetContent "0", true
          end sub

          sub market
          set y = ActiveDocument.Variables("Marketing")
          if y.GetContent.String="1" then
          ActiveDocument.Variables("Marketing").SetContent "0",true
          set button1 = ActiveDocument.getsheetobject("BU63")
          set prop = button1.GetProperties
          prop.Text.v = "Pokaz analizy marketingowe"
          button1.SetProperties prop
          else
          ActiveDocument.Variables("Marketing").SetContent "1",true
          set button1 = ActiveDocument.getsheetobject("BU63")
          set prop = button1.GetProperties
          prop.Text.v = "Ukryj analizy marketingowe"
          button1.SetProperties prop
          end if
          end sub


           

          4. In sheets you want to hide/show by macro in properties in Show Sheet write in this example - in conditional:

          Marketing = 1

           

          It shuold now works

          • hide and show tab
            Miguel Angel Baeyens de Arce

            Hi,

             

            A very similar solution I use is as follows. First, I create all tabs with their objects and I click "Show Sheet" if vVisible='value'. I use a inline table of values for vVisible for each tab I want to show/hide. When clicking the button, I execute a macro kind of

             

            Sub ShowSheet1
            ActiveDocument.Fields("vVariable").Select "Sheet1"
            ActiveDocument.Sheets("SH02").Activate //Sheet ID
            End Sub


            In the hidden tab, the "Close" button would be very similar to

             

            Sub CloseSheet1
            ActiveDocument.Fields("vVariable").Clear
            ActiveDocument.Sheets("SH01").Activate //Sheet ID for Main Tab
            End Sub


            Regards.