Author Topic: EventDblClick Macro does not open Groupshape Data  (Read 5821 times)

0 Members and 1 Guest are viewing this topic.

SoWi030

  • Newbie
  • *
  • Posts: 3
EventDblClick Macro does not open Groupshape Data
« on: July 09, 2015, 04:04:09 PM »
Hello together,

after Migration to Visio 2013 a double click event does not work as in the former Version.  Double clicking on any grouped shape it should open the data of the grouped shape by using the command Application.DoCmd (visCmdFormatCustPropEdit)
I have been looking and trying around for quite some time but have not found any solution. At least I have a clue, why the macro does not work anymore. I think it is because I am using a group of shapes. When double clicking on the group the macro should open the Shape Data of the group but does not. It opens only the shape data of one of the shapes in the group, which has no data. Therefore, I get the message “no shape data available. Do you want to define new Shape data?

The macro code called is – reduced to the minimum:

Code
Sub ShowShapeData(shpObj As Shape)
Application.DoCmd (visCmdFormatCustPropEdit)
End Sub

I tryed to somehow identify the group the shpObj is belonging to but could not succeed (unvortunately not the shapeobject itself but only its name is provided):
Code
Set GroupedShape = shpObj.ContainingShape 
GroupedShape.application.DoCmd (visCmdFormatCustPropEdit)
Do you have any idea. I’m very sporadic Visio programmer and a self learning VBA programmer, so please talk basic and give examples. I really would appreciate it.

SoWi030

  • Newbie
  • *
  • Posts: 3
Re: EventDblClick Macro does not open Groupshape Data
« Reply #1 on: July 09, 2015, 07:15:20 PM »
Ok - I am one step further. 

The Group Shape I could pick with the shpObj.Parent (see 3rd code line). But I'm still facing a problem when it comes to call the Shape-Data Dialog of it with command 'shpObj.Application.DoCmd (1312)'. Rest works fine. See coding section XXX:

Code
Sub Test(shpObj As Shape)
    Dim subShp As Shape
    Debug.Print shpObj.ID
   
    Set shpObj = shpObj.Parent 'Set the Group - Shape
   
    If shpObj.CellExists("Prop.SubShape_0102", False) Then 'Check if a valid shape was chosen
        Debug.Print "strike", shpObj.ID
        Debug.Print shpObj.Cells("Prop." & "SubShape_0102").Formula
        Debug.Print shpObj.Cells("Prop." & C_ShpName_SubShape_0302).Formula


        'XXX: shpObj.Application.DoCmd 1312 does not open the parent shape that I put into the shpObj variable (see 3rd code line)
        'XXX: If I manually switch to visio and select the parent and than go on with F8 it works
        '      -> the command opens the parent shape data Dialog with all the cells attached.
'XXX How can I make the 'shpObj.Application.DoCmd (1312)' command open the right shape
        shpObj.Application.DoCmd (1312)
       
        'Update the Subshapes from the Cell-Info (works)
        F_WriteSubShapes shpObj, F_GetFieldString(shpObj, C_ShpName_HauptShape) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0101) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0102) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0103) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0201) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0202) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0203) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0204) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0205) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0206) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0207) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0301) _
                        , F_GetFieldString(shpObj, C_ShpName_SubShape_0302)


    End If
   
End Sub

Any idea? Thanks - It's 2a.m. I will check tomorrow.
« Last Edit: July 10, 2015, 01:29:31 AM by SoWi030 »

SoWi030

  • Newbie
  • *
  • Posts: 3
Re: EventDblClick Macro does not open Groupshape Data
« Reply #2 on: July 10, 2015, 03:12:31 AM »
Solved - without programming :o
That's were your nights go  ::)

Just when I did my last Research, I found the solution. In 2013 the double-click behavior is different. You can adjust it per Master-Shape:
  • Right-click on the Master Shape to edit the Master-Data Settings in a separate window.
  • Mark everything with Ctrl+A
  • On the Development Ribbon choose 'Behavior'
  • Change the behavior to 'only group'

Thanks anyways!