none
Content control not working with word 2010 RRS feed

  • Question

  • Hi All,

    I have created word document in office 2007. According to my ribbon functionlaity,my code refreshes the contentcontrols with new data. It is working correctly in word 2007. But it is not at all working with word 2010. It is giving below error.

    The requested member of the collection does not exist.

    In fact, the content controls are getting deleted.

    It is very urgent.

    Any help is appreciated.

    Thanks,

    Dipankar

    Tuesday, February 14, 2012 12:48 PM

Answers

  • Hi Dipankat

    If you've locked the content control BEFORE putting something into it, it shouldn't be deleting. Are you sure you've done that?

    If you have, the content controls shouldn't be deleting. So you aren't providing enough information. I need to see the code that's deleting the content controls...


    Cindy Meister, VSTO/Word MVP

    Thursday, February 16, 2012 1:43 PM
    Moderator

All replies

  • Hi All,

    I have developed word addin for office 2007. But some of our users use office 2010. For them word 2010 is not functioning correcly with VSTO 2007. Is there any reason for the same?

    Reply is appreciated..

    Thanks,

    Dipankar

    Sunday, February 12, 2012 2:51 PM
  • What specifically is not functioning correctly?  In order for anyone to try and help you have to give us some detail to work with. :-)

    It's a VSTO add-in, written with VS 2010?  What language?


    Kind Regards, Rich ... http://greatcirclelearning.com

    Sunday, February 12, 2012 6:54 PM
  • Hi All,

    I have created word document in office 2007. According to my ribbon functionlaity,my code refreshes the contentcontrols with new data. It is working correctly in word 2007. But it is not at all working with word 2010. It is giving below error.

    The requested member of the collection does not exist.

    In fact, the content controls are getting deleted.

    It is very urgent.

    Any help is appreciated.

    Thanks,

    Dipankat

    • Moved by CoolDadTx Tuesday, February 14, 2012 2:56 PM Not IDE related (From:Visual C# IDE)
    • Merged by Cindy Meister MVPModerator Tuesday, February 14, 2012 4:58 PM same question
    Tuesday, February 14, 2012 12:44 PM
  • did you checked this

    http://social.msdn.microsoft.com/Forums/is/worddev/thread/36c8e052-672d-4f72-a588-ddbce9cf2a37

    https://www-304.ibm.com/support/docview.wss?uid=swg21260897

    Tuesday, February 14, 2012 1:05 PM
  • I have created word document in office 2007. According to my ribbon functionlaity,my code (C#) refreshes the contentcontrols with new data. It is working correctly in word 2007. But it is not at all working with word 2010. It is giving below error.

    The requested member of the collection does not exist.

    In fact, the content controls are getting deleted.

    It is very urgent.

    Any help is appreciated.

    Tuesday, February 14, 2012 4:33 PM
  • Hi Dipankar

    You need to show us the code, indicating which line is causing the error.


    Cindy Meister, VSTO/Word MVP

    Tuesday, February 14, 2012 5:01 PM
    Moderator
  • By the way the VSTO adding is writen in VSTO 2008 in C#.
    Wednesday, February 15, 2012 6:36 AM
  • Here is the code where I am getting the error:-

    contentControls.get_Item(ref i).LockContentControl = false;

    One more thing, I want to delete html table inside the content control and paste new html table. Below code was working perfectly with 2007 but not working in 2010. It is deleting the content control itself:-

    if (contentControls.get_Item(ref i).Range.Tables.Count > 0)

    {

    foreach (Word.Table tbl in contentControls.get_Item(ref i).Range.Tables)

    {

    tbl.Delete();

    }}

    Wednesday, February 15, 2012 1:41 PM
  • Hi Dipankat

    If you've locked the content control BEFORE putting something into it, it shouldn't be deleting. Are you sure you've done that?

    If you have, the content controls shouldn't be deleting. So you aren't providing enough information. I need to see the code that's deleting the content controls...


    Cindy Meister, VSTO/Word MVP

    Thursday, February 16, 2012 1:43 PM
    Moderator