Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to show the object TB01 if a user answers yes to a msgbox...I've got the following code but I'm struggling with the syntax to show or hide the object
sub ShowDetail()
vAnswer=msgbox("Do you want to view the raw data?",VBYesNo)
if vAnswer = VBYes then
Code to show the object to go here
else
Code to hide the object to go here
exit sub
end if
end sub
Can anyone please help?
Hi,
You can do as follows.
Create a variable say visibility. Set it to 1 (1 to show and 0 to hide).
Go to Properties of Table box -> caption tab -> check show conditional -> type "=visibility =1"
Change your macro to.
sub ShowDetail()
set var = ActiveDocument.Variables("visibility")
vAnswer=msgbox("Do you want to view the raw data?",VBYesNo)
if vAnswer = VBYes then
var.setcontent "1",true
else
var.setcontent "0",true
exit sub
end if
end sub
Regards,
Kaushik Solanki
Hi,
You can do as follows.
Create a variable say visibility. Set it to 1 (1 to show and 0 to hide).
Go to Properties of Table box -> caption tab -> check show conditional -> type "=visibility =1"
Change your macro to.
sub ShowDetail()
set var = ActiveDocument.Variables("visibility")
vAnswer=msgbox("Do you want to view the raw data?",VBYesNo)
if vAnswer = VBYes then
var.setcontent "1",true
else
var.setcontent "0",true
exit sub
end if
end sub
Regards,
Kaushik Solanki