Visio Guy

Visio Discussions => Programming & Code => Topic started by: Nikolay on February 11, 2009, 02:17:29 PM

Title: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: Nikolay on February 11, 2009, 02:17:29 PM
I have several "AnchorWindows".
Suppose I have one of them open. How do I open the second one as a "tab"?

In pictures. I have this:
(http://nbelyh.googlepages.com/dtabs1.png)

I don't want to have this after Windows.Add:
(http://nbelyh.googlepages.com/dtabs2.png)

I want to have this instead:
(http://nbelyh.googlepages.com/dtabs3.png)

I believe this has something to do with MergeID and other funny parameters "Windows.Add" method has.
But unfortunately I haven't found any examples or sane documentation on how do I use those..?

I mean, how do I use the Windows.Add (bla-bla-bla, MergeID, MergeClass, MergePosition)
Any help?

Kind regards,
Nikolay.
Title: Re: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: michelleh on March 25, 2009, 07:10:45 AM
Did you ever figure this out?  I'm trying to do this, too.
Title: Re: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: Visio Guy on March 25, 2009, 10:52:38 AM
I've put in a question to Microsoft, since this has been a mystery for quite some time.

I've scoured the web, the SDK, the SDK help file, the code library, Even Graham Wideman's Visio 2003 Developer's Survival Pack (http://www.amazon.com/gp/redirect.html?link_code=ur2&tag=wanderkind-20&camp=1789&creative=9325&location=%2FVisio-2003-Developers%2Fdp%2F1412011124%2Fref%3Dsr_11_1%3Fie%3DUTF8) and David Parker's Visualizing Information with Microsoft Visio 2007 (http://www.amazon.com/gp/product/007148261X?ie=UTF8&tag=wanderkind-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=007148261X) haven't solved it in their wonderful books.

I found several attempts to tackle this on my hard drive, so the question has evidently been around for awhile, and unsolved it seems.
Title: Re: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: michelleh on March 25, 2009, 02:05:50 PM
Thanks.  At least now I can stop digging for an answer.
Title: Re: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: JuneTheSecond on December 01, 2009, 12:13:09 AM
Hi,

I am now trying a macro.
How does it go in your Visio? :)


Sub test()
    On Error GoTo EHND
    Dim win1 As Window
    Dim win2 As Window
    Set win1 = ActiveWindow.Windows.ItemFromID(visWinIDPanZoom)
    Set win2 = ActiveWindow.Windows.ItemFromID(visWinIDSizePos)
    win1.Visible = True
    win2.Visible = True
    win1.MergeID = "{85C3FFCD-2556-4813-BDD9-426B9C490181}" 'Any other ID may be OK.
    win2.MergeID = win1.MergeID
    win1.Visible = False
    win1.Visible = True
    Exit Sub
EHND:
   
End Sub

Title: Re: Merging Anchor Windows Programmatically So They Are Tabbed
Post by: JuneTheSecond on December 02, 2009, 11:00:46 AM
Hi,

But how can I unmerge the merged windows again?
I've tryed Win1.MergeID="{00000000-0000-0000-0000-000000000000}".
But I could never change MergeIDs of the anchor wndows, if once they are merged.

I've tryed SetWindowRect to move a window in the merged windows.
But all windows moved togather, and did not separate each other.

Any other idea?