How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ? - InfoPath Dev
in

InfoPath Dev

How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

Last post 06-26-2007 04:53 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-10-2007 10:24 PM

    How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    Hello All,

     Does anybody know how to capture the "Mouse Hover" event on a button in InfoPath ? I want to change the mouse cursor on this event.

    Please help at the earliest. 

     

    Regards,

    Anandhi

  • 06-11-2007 10:05 AM In reply to

    Re: How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    This is not possible due to sandboxing. However, you can modify the view .xsl file and add the style='cursor: xyz' to the <input type='button'/> tag.
  • 06-11-2007 10:14 PM In reply to

    Re: How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    Thanks for your reply..

    I had another query for which i need a confirmed answer.

    Query : I want to send an InfoPath form in the body of my email thru code.

    //// CODE STARTS

    public string sendMail()
    {
    // Create an InfoPath Application object.

    Microsoft.Office.Interop.InfoPath.Application myApp = new Microsoft.Office.Interop.InfoPath.Application();  // ------------------------ ERROR 1

    // Get a reference the XDocuments collection
    // and open the sample form.
    XDocumentsCollection myXDocs = myApp.XDocuments;
    XDocument myXDoc = myXDocs.NewFromSolution(@\\ps2578\FormsForProTrack\EmailDataConnectionForm1.xsn);  //---------------------- ERROR 2
    myXDoc.SaveAs(@"\\ps2578\FormsForProTrack\Test1.xml");
    myXDocs.Close(0);

    myXDoc = myXDocs.Open(@"\\ps2578\FormsForProTrack\Test1.xml", (int)XdDocumentVersionMode.xdFailOnVersionOlder);

    // Access the XML DOM for the underlying XML document using
    // the DOM property. Note that you must cast to the
    // IXMLDOMDocument2 type from the
    // Microsoft.Office.Interop.InfoPath.Xml namespace
    // to access the XML DOM.

    IXMLDOMDocument2 myXMLDoc = myXDoc.DOM as IXMLDOMDocument2;

    // Set the MSXML SelectionNamespaces property to the my
    // namespace of the form. IMPORTANT:Replace the namespace
    // with that of your sample form.
    myXMLDoc.setProperty("SelectionNamespaces", "xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-08T08:28:17'");


    IXMLDOMNode myXMLNode = myXMLDoc.selectSingleNode("//my:field1");
    myXMLNode.text = "Mrudula";

    EmailAdapter da = (EmailAdapter)myXDoc.DataAdapters["Email Submit"];

    da.Submit();

    // Save the updated form as Form2.xml and close out.
    myXDoc.SaveAs(@"D:\MOSS\ProTrack\InfoPathForms\Test.xml");
    myXDocs.Close(0);
    myApp.Quit(false);

    return ("Finished!");

    }  ///CODE ENDS
    When i write this code in a web service, I get an error on the line which is marked as ERROR 1 in the above code
    Error-

    Retrieving the COM class factory for component with CLSID {8075635F-5146-11D5-A672-00B0D022E945} failed due to the following error: 80070005 
    When i write the same code in a class library and use the built DLL in my application i get an error on the line marked ERROR 2 but the code terminates after this line. So, i cannot capture the error message.
    Also, please tell me whether i can send a mail having the embedded InfoPath form into it without using the EMAIL ADAPTER and MAIL ENVELOPE thru some CODE ? (preferrably C# code). I want to send the mail thru workflow.
    Please reply soon since it is urgent.
    Thanks and Regards,
    Anandhi
      
  • 06-12-2007 09:32 AM In reply to

    Re: How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    Please note that I have only looked over your code, and have not actually tried to run any of it. 

    ERROR 1: You don't need to create a new app. Just reference XDocuments directly.
    ERROR 2: You are missing your quotes.

    Microsoft.Office.Interop.InfoPath.Application myApp = new Microsoft.Office.Interop.InfoPath.Application();  // ------------------------ ERROR 1

    // Get a reference the XDocuments collection
    // and open the sample form.
    XDocumentsCollection myXDocs = myApp.XDocuments;
    XDocument myXDoc = Application.XDocuments.NewFromSolution(@"\\ps2578\FormsForProTrack\EmailDataConnectionForm1.xsn");  //---------------------- ERROR 2
    myXDoc.SaveAs(@"\\ps2578\FormsForProTrack\Test1.xml");
    myXDocs.Close(0);

     

  • 06-26-2007 12:19 AM In reply to

    Re: How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    I am writing the code not in the code behind of the form but in the class library so I am not able to access the Application.XDcuments. I am using the InfoPath 2003 object model to send the form through mail which will come as a embedded in the body in the outlook.

    Following are the steps that I followed-

    1) Created the Infopath form with the data connection for Email as "Email Submit". Form named as "EmailDataConnectionForm.xsn"

    2) I have created the classlibrary for accessing the instance of the "EmailDataConnectionForm.xsn" Form and accessing the "Email Submit" data connection from code in the classlibrary. As it automatically sends the InfoPath form in the mail which will come as embedded form in the Outlook by just accessing the "Email Submit" data connection from code.

    I have used the same code that I have sent above as ERROR1 comment I couldnt try out because I couldnt get the access to the Application.XDocuments.

    I want to know how should I proceed now? Whether my way is right or is there any better solution to do the same?

    If this is the right way then How I should I supress the form as it opens up the form instance when I do the NewFromSolution(). I want to send the form in the mail automatically without any pop up window to user.

    This is kind of urgent. Please reply urgently.

    Thanks & Regards,

    Anandhi

     

     

     

  • 06-26-2007 04:53 PM In reply to

    Re: How can the MOUSE HOVER be captured on an InfoPath BUTTON thru CODE ?

    Can you pass in the Application and XDocument as parameters to initialize your class library? That would give you the handles you need to do what you want.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.