0
Visio 2007에서 VBA를 통해 특정 레이어를 svg로 내보내려고합니다.Visio 2007 VBA에서 선택 영역에 레이어를 추가하는 방법은 무엇입니까?
선택 항목에 레이어를 추가하는 데 어려움이 있습니다. 어떻게해야합니까?
Sub tester()
Dim Layer As Visio.Layer
Dim Layers As Visio.Layers
Dim sel As Visio.Selection
Dim filename As String
Dim lyrName As String
Dim iLays As Integer
Set Layers = Application.ActivePage.Layers
Set sel = EmptySelection 'Or whatever empty initialization neeeds to happen...
For iLays = 1 To Layers.Count
Set Layer = Layers(iLays)
lyrName = Layer.Name
If lyrName = "Walls" Or lyrName = "Zones" Then
sel.AddLayer (lyrName) 'or some such nonsense - This is broked.
End If
filename = Application.ActiveDocument.Path & "PootyStuff.svg"
'Export the page as svg file
sel.Export filename
Next iLays
Set Layer = Nothing
Set Layers = Nothing
End Sub