How to call Word Templete in a drop-down field? - InfoPath Dev
in

InfoPath Dev

How to call Word Templete in a drop-down field?

Last post 09-17-2008 05:04 PM by Jamesliang. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-16-2008 04:23 PM

    How to call Word Templete in a drop-down field?

    I hope user use drop-down list field to choice a word templete and then system will open this word templete. does anybody can help me?

     

    Thanks 

     

  • 09-17-2008 06:23 AM In reply to

    Re: How to call Word Templete in a drop-down field?

    Hi Jamesliang,

    By writing the following code we can open the word document based on the value selected by the user in the drop down list box.

    The steps that you need to follow for getting the word document opened are:

    ·         Right click the drop down list box , based on which the word document needs to be opened and select Programming option.

    ·         In Programming, select “On After Change Event”.

    In On After change function of a drop down list box, please write the following code:

    if (eventObj.IsUndoRedo || eventObj.Operation == "Insert"){              return;}var wordApp = new ActiveXObject("Word.Application");wordApp.Documents.Open(eventObj.Site.text);

    wordApp.Visible = true;

    Chandrakanth/GGKTech
  • 09-17-2008 09:04 AM In reply to

    Re: How to call Word Templete in a drop-down field?

    Thanks a lot.

  • 09-17-2008 05:04 PM In reply to

    Re: How to call Word Templete in a drop-down field?

    Hi Chandrakanth.

      when I used VSTA to write this code, system display :

    Error 1 The name 'eventobj' does not exist in the current context C:\Documents and Settings\JamesLiang.VFF\My Documents\InfoPath Projects\CSR_82611\FormCode.cs 36 17 CSR_8261
    Error 2 The name 'eventObj' does not exist in the current context C:\Documents and Settings\JamesLiang.VFF\My Documents\InfoPath Projects\CSR_82611\FormCode.cs 36 40 CSR_8261
    Error 3 The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\JamesLiang.VFF\My Documents\InfoPath Projects\CSR_82611\FormCode.cs 37 13 CSR_8261
    Error 4 The type or namespace name 'ActiveObject' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\JamesLiang.VFF\My Documents\InfoPath Projects\CSR_82611\FormCode.cs 38 17 CSR_8261
    Error 5 The name 'eventObj' does not exist in the current context C:\Documents and Settings\JamesLiang.VFF\My Documents\InfoPath Projects\CSR_82611\FormCode.cs 39 36 CSR_8261

    Can you let me know what's happen?

     

    Thanks

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.