Threads in InfoPath - InfoPath Dev
in

InfoPath Dev

Threads in InfoPath

Last post 01-24-2006 02:30 AM by Mancha. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-18-2006 01:32 AM

    Threads in InfoPath

    Can i use threads in InfoPath? Who implement I this in C#.
  • 01-19-2006 10:58 AM In reply to

    That's a good question, I don't know if this has ever been tried before. Why do you need to use threads?

    Here are some references on creating threads in C#:

    http://www.codeproject.com/csharp/workerthread.asp
    http://www.suite101.com/article.cfm/c_sharp/96436

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-23-2006 04:09 AM In reply to

    My problem is that I compare a form with another form. I compare the forms by using the Word functionaliy. It takes a few seconds and the user have to wait so long. My suggestion is using threads in InfoPath?
  • 01-23-2006 09:41 PM In reply to

    Hi Mancha,
    How are you comparing a form by using the Word functionality?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 01-24-2006 02:30 AM In reply to

    I save the previous form and the current form as doc file and then I use the Word functionality. Do you have another solution to comparing two forms with richtext fields?
    The comparing result I save this as mht file to view the changes also in a browser.

    Here is sample code:

    object currentFile = currentDoc;
    object compFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + compareFileName;
    object fileFormat = Word.WdSaveFormat.wdFormatWebArchive;
    object missing = Missing.Value;
    object objTrue = true;
    object objFalse = false;
    object compareTarget = Word.WdCompareTarget.wdCompareTargetNew;
    object saveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;


    Word.Application wordApp = new Word.ApplicationClass();
    wordApp.Visible = false;
    Word.Document oDoc = wordApp.Documents.Open(ref currentFile, ref objFalse, ref objFalse, ref objFalse, ref missing, ref missing, ref objFalse, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

    oDoc.Compare(backupDoc, ref missing, ref compareTarget, ref objFalse, ref objFalse, ref objFalse, ref objTrue, ref objTrue);

    Word.Document compDoc = wordApp.ActiveDocument;

    compDoc.SaveAs(ref compFile, ref fileFormat, ref objFalse, ref missing, ref objTrue, ref missing, ref objFalse, ref objFalse, ref objFalse, ref objFalse, ref objFalse, ref missing, ref missing, ref missing, ref missing, ref missing);
    compDoc.ActiveWindow.View.Type = Word.WdViewType.wdWebView;

    oDoc.Close(ref saveChanges, ref missing, ref missing);

    wordApp.Visible = true;
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.