Auto Arranage Side-By-Side command

S

sureshsa_2000

Hi everybody,

I am using Visio 2003 in that I could programatticaly call Auto Arrang
Subordinates menu and select side by side option it works.

I used the below code
-------------start-----------
ActiveWindow.Selec
Application.ActiveWindow.Page.Shapes.ItemFromID(shpObj.ID), visSelect

Application.Addons("OrgC11").Run ("/cmd=layoutdlg")

ActiveWindow.DeselectAll
-------------End-----------

But I requires through code to atomatically select the option
Auto Arranage Side-By-Side to draw my chart .

If any one could help out it would be great.

Thanks in Advance
Suresh
 
J

JuneTheSecond

Senkeys might be an idea.
But the program should be devided into 2 parts.
First to open the dialog, and second to send keys.
These 2 independent exe progs might called from main program.
 
J

JuneTheSecond

For example in VB.Net2005,
'Main Program
Imports System.Threading
Module Module1
Sub main()
Dim myVisioPath As String
Dim myKeyPath As String
myVisioPath = "C:\myDocuments\myVisioSettings.exe"
myKeyPath = "C:\myDocuments\mySendKeys.exe"
Process.Start(myVisioPath)
Thread.Sleep(800)
Process.Start(myKeyPath)
End Sub
End Module

'myVisioSettings
Module Module1
Sub main()
Dim app As Microsoft.Office.Interop.Visio.Application
app = GetObject(, "visio.application")
Dim shp As Microsoft.Office.Interop.Visio.Shape
shp = app.ActivePage.Shapes.ItemFromID(1)
app.ActiveWindow.Select(shp,
Microsoft.Office.Interop.Visio.VisSelectArgs.visSelect)
app.Addons("OrgC11").Run("/cmd=layoutdlg")
shp = Nothing
app = Nothing
End Sub
End Module

'mySendKeys
Imports System.Threading
Module Module1
Sub main()
AppActivate("Caption of Diagram")
My.Computer.Keyboard.SendKeys("%O", True)
Thread.Sleep(200)
My.Computer.Keyboard.SendKeys("{ENTER}", True)
End Sub
End Module
 
S

sureshsa_2000

Hi John,

First of all Thanks for your answer.
Can you give the written code by you in Visual Basic 6.0. code

Thanks & Regards
Suresh
 
S

sureshsa_2000

Hi JuneTheSecond,

I found the key word "MsoOrgChartOrientation" .
But how to declare and use it for Verticval Orientation Iam strugglin
can You help me out.

Thanks & Regards
Suresh
 

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