Enabling or Disabling of Custom Toolbar Buttons - InfoPath Dev
in

InfoPath Dev

Enabling or Disabling of Custom Toolbar Buttons

Last post 08-07-2005 10:40 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-05-2005 03:21 AM

    • neel_hp
    • Not Ranked
    • Joined on 08-04-2005
    • India
    • Posts 2

    Enabling or Disabling of Custom Toolbar Buttons

    Hi all,
    I am developing a infopath form in which i have added a custom
    toolbar , now i want to add functionality to enable or
    disable button in toolbar based on role defined in Tool-->User
    roles menu.
    I tried doing this through VS.NET toolkit for infopath.
    and first registered the form template through regform
    utility and trying to disable the button in custom toolbar
    using Microsot Office core library as a reference.
    but still it is giving security related exception as
    System.Security.SecurityException
    That assembly does not allow partially trusted callers.
    at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
    at InfoPathProject2828.InfoPathProject2828.OnLoad(DocReturnEvent e)
    at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)

    please help me out and suggest if their are any other method for disabling or enabling of custom tool bar buttons based on user roles.
  • 08-05-2005 07:59 AM In reply to

    Re: Enabling or Disabling of Custom Toolbar Buttons

    Hi,

    If you make this in debug or preview mode it's normal you need to publish your form in full trust! go on tools->form option->security and change the security level tofull trust and sign it! Go on msdn website you can find a very good explanation for the security level and how to sign a form in infopath!

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 08-05-2005 09:45 AM In reply to

    Re: Enabling or Disabling of Custom Toolbar Buttons

    Hmm. I don't know of any direct way to enable/disable the toolbar buttons unless they are tied to insert/delete of optional/repeating sections -- and then its fairly automatic.

    I do recall reading other discussions (don't recall where) in which people used full trust forms and code that reached directly into the InfoPath window to do this kind of work -- but I think that was more for the InfoPath system menus and buttons. I don't recall if that is the same approach needed here or not.

    I really don't know on this one. There might be a way, I just can't think of it though. I don't recall seeing anything in the DOM for it.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 08-07-2005 08:57 PM In reply to

    • neel_hp
    • Not Ranked
    • Joined on 08-04-2005
    • India
    • Posts 2

    Re: Enabling or Disabling of Custom Toolbar Buttons

    hi,
    thaknx,for prompt reply,
    i will try it out but, can we enable or disable custom tool
    bar button based on a field's value in infopath form template.

  • 08-07-2005 10:40 PM In reply to

    Re: Enabling or Disabling of Custom Toolbar Buttons

    Hi Neel,
    You could probably write code to do it, but I have never heard of anyone actually doing this. Why not just put the buttons in your form. Then, it's easy.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.