Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I try to explain as best as possible
I need to hide a few sheets via vbscript macro, so that when i print the document they are not visible. i can retrieve a sheet via its id and then hide/show it?
example:
function Hide
Dim strValueToDisplay
strValue = split(ActiveDocument.Variables("vHideSheetList").GetContent().String,",")
for each sheetId in strValue
ActiveDocument.Sheets(sheetId).Hide
nextend function
function Show
Dim strValueToDisplay
strValue = split(ActiveDocument.Variables("vHideSheetList").GetContent().String,",")
for each sheetId in strValue
ActiveDocument.Sheets(sheetId).Show
nextend function
why not setting up a variable for conditional view of the sheets?
then you are able to set this variable to a certain value per macro:
Function setVariable
set v=ActiveDocument.Variables("YOURVARIABLE")
v.Forcecontent "1",1
END function
hope this helps
Because I have a need to hide / show a list of pages that the user chooses dynamically. Do not I have to show / hide them all together
thx!
Why do you want to use Macros to hide/show sheet?
It is best to avoid Macros.
You can use Condition expression in sheet Properties to show/hide
i know that i can hide/show sheet with the sheet properties
But i'm forced to use the procedure that i described before using macros ( using a list of sheet's id i want to use a loop to iterate the list and hide all sheets leaving out those selected in the list)