2012-12-13 47 views
1

我有一個複雜的模板,其中有很多小的形狀(表6至43),分組在一組(表格44)。它也有子組。如何在模板中隱藏Visio形狀組

我想隱藏這個組使用圖形公式來使用用戶屬性。

在一個簡單的形狀,我會設置:! Geometry1.NoShow = sheet.44 user.isHidden Miscellaneous.HideText = sheet.44 user.isHidden

但如何使其繼承了所有的子形狀?與vba?

編輯與解答:

感謝您對喬恩說corfirming沒有比VBA沒有其他辦法。 這是我的VBA代碼,適用於所有遇到同樣問題的人。

Call makeithidden("Sheet.164!Geometry1.NoShow", myshape) 


Sub makeithidden(formula As String, ByVal myshape As Shape) 
    For Each subShape In myshape.Shapes 
     subShape.Cells("geometry1.noShow").FormulaForceU = formula 
     subShape.Cells("HideText").FormulaForceU = formula 
     Call makeithidden(formula, subShape) 
    Next subShape 
End Sub 

再見!

回答

1

您的VBA代碼將不得不遍歷所有子形狀,並隨時設置該公式,任何時候該組獲得新的形狀。該公式的格式將是就像你的榜樣,所以它不會是太難的事:

SubShp.CellsSRC(visSectionFirstComponent,0,2).FormulaU = "Sheet." & Cstr(ParShp.ID) & "!Geometry1.NoShow" 

或類似的東西,在那裏這是在ParShp.Shapes每個SubShp環...