Author Topic: Very simple mini shape explorer driven by VBA macro only  (Read 24358 times)

0 Members and 1 Guest are viewing this topic.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Very simple mini shape explorer driven by VBA macro only
« Reply #15 on: September 17, 2010, 06:58:31 AM »
Modified the program so that each tree view may have correct view
with corresponding document page when multi drawings are opened.
For this purpose activePage must be replaced by the page where treeview window is open.
ActiveWindow.ID is passed from button1_Click in Ribbon.cs via AnchorBarUsage.cs to Form1.cs.
All ActivePage in Form1.cs are replaced to visioActivePage.
visioActivePage = app.Windows.get_ItemFromID(visiowindowID).Page.
And please, save Ribbon designer once before run the project.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

nashwaan

  • Full Member
  • ***
  • Posts: 85
Re: Very simple mini shape explorer driven by VBA macro only
« Reply #16 on: May 24, 2011, 11:03:54 PM »
"private void addPicture" in "Form1.cs" is surprisingly simplified.
It has been done by refering to Nikolay's  useful post at
http://visguy.com/vgforum/index.php?topic=2065.msg9299;topicseen#msg9299"

Code

private void addPicture(IPictureDisp pic, String key)
        {

            Image img = new Metafile((IntPtr)pic.Handle, true);
            Bitmap bmp = new Bitmap(img);
            this.imageList1.Images.Add(key, bmp);

        }


Hi, Is there a way to do the same thing in VBA?
I need to convert visio's Shape.Picture (which is of type IPictureDisp but in EMF format "See Visio Automation Reference") to a IPictureDisp in bitmap format. Because the ListImages of TreeView refuses to understand 'IPictureDisp in EMF format'.
What do i need to convert Shape.Picture to bitmap and then to icon? in VBA (not VB.NET and not C#), please.

BTW, Junichi, i think you actually ment to refer to Nicolay's post rather in this link http://visguy.com/vgforum/index.php?topic=2029.msg9142#msg9142
Thanks,
Yousuf.
Give me six hours to chop down a tree and I will spend the first four sharpening the axe — Abraham Lincoln

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Very simple mini shape explorer driven by VBA macro only
« Reply #17 on: May 26, 2011, 01:56:13 AM »
I am very sorry to late, but I've forget about the details.
It would take much more time to remember.
Best Regards,

Junichi Yoda
http://june.minibird.jp/