Creating and Using UniqueIDs in Shapes RRS feed

  • Question

  • Hello all,
    I'm not new to Visio nor to programming but I am new to developing in Visio.
    I'm using 2007 and am creating my own custom shapes with Shape Data.
    I want to create a UniqueID for all my shapes in the context of the drawing.
    I have created a Shape data element called 'Shape UniqueID'. (ShapeSheet  Prop.Shape_Unique_ID)
    I tried to generate a unique ID (Shape.UniqueID property), using the formula syntax below, in the ShapeSheet 'Value' cell for the property : 
        =UniqueID(visGetOrMakeGUID)   and =UniqueID(1)
    But Visio does not recognize this as a valid Formula..

    I also tried to use DATA1():
    That gives me a unique value BUT it does not update if you copy the shape.

    I've dowloaded the 2007 SDK and can't find a Shapesheet function to read the properties.

    I have also seen that you can set the page so UniqueIDs are always on shapes used but I can't figure out how to turn it on.

    My "preference" is to use a Shape Data element and set it BUT......
    Any Ideas would be appreciated?
    Thanks ... Scott
    Saturday, June 8, 2013 12:18 AM

All replies

  • Hi Scott,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 12, 2013 11:11 AM
  • Hi Scott,

    I need a little clarification here. You say that you "want to create a UniqueID for all my shapes in the context of the drawing." and that by using "=Guard(Data1())" you get a unique value "BUT it does not update if you copy the shape.". What do you mean by does not update? For example, assume I create a shape (I will call it "Shape1") with a unique ID of "25". When I copy and paste this shape (which I will call "Shape2") should the unique ID of Shape2 be "25" or "26" (assuming 26 is also unique)?

    Are you doing this programming within Visio in VBA or is your code external to the Visio document (such as an add-in)?

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, June 13, 2013 4:20 PM