none
Microsoft.Office.Interop.Word.ContentControls.Add throws NotImplementedException RRS feed

  • Question

  • For some reason one computer throws NotImplementedException (The method or operation is not implemented) in Microsoft.Office.Interop.Word.ContentControls.Add. It works fine on other computers. Any idea what might be a problem?

    Here Is exception info:

    Message: The method or operation is not implemented.Source: Microsoft.Office.Interop.WordException

    Type: System.NotImplementedException

    StackTrace: at Microsoft.Office.Interop.Word.ContentControls.Add(WdContentControlType Type Object& Range) at

     


    Victor - Lead Software Developer
    TeamLook - TFS Outlook Integration
    TeamSpec - TFS Requirements Management Integration
    Friday, June 3, 2011 5:53 PM

Answers

  • My problem solved. I was first doing a conversion from a .dot file which (silently) failed. Then when adding the content control I of course got the notimplementedexception since the document wasnt in openxml-format.

    Monday, June 13, 2011 12:54 PM

All replies

  • Which version of Office is involved?

    Against which version of Office was your program programmed and compiled?

    Please show us the relevant code that causes the error. (Yes, I know it's using ContentControls.Add, but it might help to see more of what's going on, such as what precedes that call.)

    You've posted in the VSTO forum: Is the VSTO technology involved in your question in any way, or are we dealing purely with "Interop"?


    Cindy Meister, VSTO/Word MVP
    Saturday, June 4, 2011 6:07 AM
    Moderator
  • I think I have the same problem using Interop (no VSTO). I know this is the VSTO-forum but since this post was already here...

     

        _wordApplication = New Microsoft.Office.Interop.Word.Application
        _wordApplication.Documents.Open(FileName:="test.docx")
        _wordApplication.ActiveDocument.ContentControls.Add(WdContentControlType.wdContentControlText)
    
    

    throws NotImplementedException. Doesnt matter which content control type, they all fail.


    Microsoft.Office.Interop.Word.dll version 14

    Microsoft Word 2010

    .Net 4.0

    Windows 7 64

     

    Any hint is appreciated.

    Friday, June 10, 2011 2:17 PM
  • In my case it's VSTO add-in. It's also not related to content control type. I don't have a computer where I can repro this problem, but were some clients who reported this error.
    Friday, June 10, 2011 8:48 PM
  • My problem solved. I was first doing a conversion from a .dot file which (silently) failed. Then when adding the content control I of course got the notimplementedexception since the document wasnt in openxml-format.

    Monday, June 13, 2011 12:54 PM
  • More detail please!

    I have a simple piece of code like this

    var vstoDoc = Globals.Factory.GetVstoObject(currentDoc); var richTextControl1 = vstoDoc.Controls.AddContentControl(Globals.ThisAddIn.Application.Selection.Range, 

    "test1"WdContentControlType.wdContentControlRichText);

    I still get the same exception!

    Did I do something wrong ?

    Thursday, July 12, 2012 4:31 AM
  • range.ContentControls.Add(WdContentControlType.wdContentControlRichText, ref _missing) throws System.NotImplementedException.

    stack trace

    Type : System.NotImplementedException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : The method or operation is not implemented.
    Source : CCH.Tax.CorrespondenceManager.Office2010Editor
    Help link : 
    Data : System.Collections.ListDictionaryInternal
    TargetSite : Microsoft.Office.Interop.Word.ContentControl Add(Microsoft.Office.Interop.Word.WdContentControlType, System.Object ByRef)
    Stack Trace :    at Microsoft.Office.Interop.Word.ContentControls.Add(WdContentControlType Type, Object& Range)
       at CCH.Tax.CorrespondenceManager.Office2010Editor.Word2010Editor.InsertContentControl(Range& rg, NameValueCollection attributes, Boolean isSpaceRequired, Boolean isContentsLocked)

    Tuesday, January 29, 2013 8:20 PM
  • if document open in compatible mode, contentcontrols.add method will throw System.NotImplementedException. 

    so check the document open mode first: see the word app tile

    Thursday, January 9, 2014 9:39 AM