Programaticly recognize a sychronized shape

T

Tim Nash

I have vba code looping though an organization chart created from the wizard.
I am looking for a custom property which was imported that acts like a flag
and creating a synchronized copy of the shape once I find the flag set. I am
running into two problems I am hoping you guys can help me out with.
1. I am calling the orgcc11 with command LinkCopyBranch to create the
synchronized copy, is there any way I can automate this add on with default
settings to create on new page and to hide subordinate shapes so the user
doesn’t actually have to interact with the add on?
2. Once I create my synchronized copy is there any property I can check on
the resulting page to or shapes to determine that it is a synchronized copy?
I am running into an infinite loop there I keep synchronizing my synchronized
copies.

Thanks.
 
J

JuneTheSecond

Hi, Tim.
My idea is for only your question 1.

One of the ways might be to simulate menu operation
with CommandBarControl.Execute method.
Parameter nedded for execution might be examined by
CommandBarControl.Parameter property.

This is the test code to export data in OrgChart.
Sub ExportORGChart()
Dim myComB As Office.CommandBar
Dim myCont As Office.CommandBarControl
Dim subBut As Office.CommandBarButton

Set myComB = Application.CommandBars("Menu Bar")
' For Each myCont In myComB.Controls
' Debug.Print myCont.Index, myCont.Caption, myCont.ID
' Next
Set myCont = myComB.Controls(9) ' Should be proper Item from above.

myCont.Controls(9).Parameter = "/exportorgdata /FILENAME=C:\test.xls"
myCont.Controls(9).Execute

' Debug.Print myCont.Controls(9).Parameter
' Set subBut = myCont.Controls(9)
' Debug.Print subBut.ID

End Sub
 
A

Al Edlund

As a thought, when you create your new page add a user or custom property to
the pagesheet to flag it as a new copy. This gives you something to check as
a flag.
al
 
J

JuneTheSecond

For your question 2,
document sheet has a user defined row named USER.HASSYNCCOPIES.
I cold not find out any other sign .
 
J

JuneTheSecond

Saved OrgChart drawing has a huge amount of SolutionXml data.
It may be there, but I could not find.
 
J

JuneTheSecond

Found that each sync coppied pages has a layer named "Hidden".
But it may not be the point to specify which shapes are sync coppied.
 
J

JuneTheSecond

Got final answer.
If 2 org shapes has same User.PositionID, then they are synchronized.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top