在VBA中更改组织结构图下属的布局不起作用

时间:2019-09-04 17:57:39

标签: vba visio

在Visio 2019 Standard中,我有一个使用组织结构图向导创建的组织结构图,并且我想通过宏更改组织结构图中下属的布局。我找到了一些可以解决问题的代码(请参见下文),但是应该更改布局的行根本没有更改布局。

this page中,我发现应该在宏中添加如下内容:

Call visio.Application.Addons("OrgC11").Run("/toolbar_horiz1")

This page具有相似之处,但其中一位发帖人提出了有关Visio版本的问题,我不确定是否相关,所以我在此添加。

我正在基于第一页所附的代码运行宏,以下是相关部分的样子:

    For i = 1 To sel.Count
        Set shp = sel(i)
        If shp.CellExists("User.Solsh", False) Then
            If shp.Cells("User.Solsh").Formula = "{0BF98B35-200C-41D5-8A23-20EF77CBC94A}" Then
                If shp.Cells("User.ShapeType").ResultInt(visNoCast, False) = 1 Then     ' MANAGER
                    ActiveWindow.Select shp, visDeselectAll + visSelect

                    Call Visio.Application.Addons("OrgC11").Run("/toolbar_horiz1")

                End If
            End If
        End If
    Next i

0 个答案:

没有答案