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