none
Visio Addin - Prevent specific Visio modal dialogs to be opened RRS feed

  • Question

  • Hello,
     
    we have developed a Visio Addin (VSTO solution). Now some customers have the need that, under some circumstances, only specific users can do specific actions in our Addin or Visio.
     
    Of course I am able to restrict our own Methods/Functions/Dialogs in our Addin.
    Also i found ways of preventing e.g. the Visio ShapeSheet to be opened if it should be forbidden for some users. I did this via WindowOpened Handler.
     
    But, the biggest problem for us and our customers is, that it should be forbidden for some users (of course only if our addin has been loaded, not for visio in general) to open the "Define shape data" dialog (visCmdFormatCustPropDef, nScopeID 1687). Only one person should be allowed to add/delete/change user defined shape data.
     
    I tried working with EnterScop/ExitScope Handler, but they are only fired when the Dialog Box is already closed (and changes have already be made).
     
    I know there is a handler for BeforeModal Event, but i have no idea if i can reference only specific dialogs inside it. And, of course, the dialog box should be closed immidiately after it has been opened.
     
    I am really stuck right now and even dont know if there is an acceptable solution for this problem.

    I will be happy about every idea you might have,
     
    ThHartl


    Wednesday, April 18, 2012 5:55 AM

Answers

  • Oh David,

    what should i say? You made my day ;-)

    This is exactly what we were looking for, and its a shame, we didn't find out. If you are ever in our neighbourhood you are invited to a biiig glass of beer.

    As i write this lines, i saw that in our company there even is a signed copy (of yourself) of one of your books, it should have come to my mind to ask you before.

    By the way, i shall relay you greetings from my boss (Mr. Hans Kobsa, FaciWare GmbH), i think you know him. He also is very glad that this issue can be handled in the future.

    Have a nice day,

    ThHartl

    Thursday, May 3, 2012 3:09 PM

All replies

  • Hi ThHartl,

    Thanks for posting in the MSDN Forum.

    Would you please clarify your Visio version and Visual Studio version for further research?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 20, 2012 7:42 AM
    Moderator
  • Hello Tom,

    Visio 2010 Professional and Visual Studio 2010 Professional.

    Thank you,

    Friday, April 20, 2012 8:01 AM
  • Hi ThHartl,

    I will involve some experts into this thread, there might be some time delay. Thanks for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 23, 2012 7:24 AM
    Moderator
  • Hi Tim,

    no problem, take your time.

    Monday, April 23, 2012 7:52 AM
  • Hello ThHartl

    Before you can specifically limit the appearance of a dialog with code you will need to demonstrate to yourself that you can do that through the user interface. Please do that and note the steps required to control how you make Visio restrict access to a single user.

    Regards,
    Chris Jensen


    Chris Jensen

    Monday, April 23, 2012 3:25 PM
    Moderator
  • Hello cjatms,

    as i haven't found a way to restrict access to this specific "define shape data" dialog (unlike e.g. switching on/off "developer mode") through the Visio UI, i think there is no (easy) way to achive my goals...

    Thank you,

    Thomas Hartl

    Tuesday, April 24, 2012 6:15 AM
  • If you have your own masters, then you can disable the Define Shape Data button by changing the LockCustProp cell to 1 or True.

    David J Parker MVP (Visio) http://davidjpp.wordpress.com/

    Thursday, May 3, 2012 12:56 PM
  • Oh David,

    what should i say? You made my day ;-)

    This is exactly what we were looking for, and its a shame, we didn't find out. If you are ever in our neighbourhood you are invited to a biiig glass of beer.

    As i write this lines, i saw that in our company there even is a signed copy (of yourself) of one of your books, it should have come to my mind to ask you before.

    By the way, i shall relay you greetings from my boss (Mr. Hans Kobsa, FaciWare GmbH), i think you know him. He also is very glad that this issue can be handled in the future.

    Have a nice day,

    ThHartl

    Thursday, May 3, 2012 3:09 PM
  • In Visio 2010, you can repurpose Fluent UI buttons ...

    http://msdn.microsoft.com/en-us/library/bb462633(v=office.12).aspx

    Download list of idMsos : http://www.microsoft.com/en-us/download/details.aspx?id=6627

    However, Visio also has shortkut keys (accelerators) to some commands, but you can use OnKeystrokeMessageForAddon event to trap this : http://msdn.microsoft.com/en-us/library/ff767265.aspx


    David J Parker MVP (Visio) http://davidjpp.wordpress.com/

    Thursday, May 3, 2012 3:23 PM