locked
Runtime Error 4605 - Inserting Image into Content Control RRS feed

  • Question

  • Hi, 

    I am trying to paste an object into a image content control in Word using the following code:

                        

                    DynamicContent.Range.Select
                    WordObject.Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, Placement:=wdInLine, DisplayAsIcon:=False

    Where DynamicContent is the Content Control object

    I have set the following properties:

                        .LockContentControl = False
                        .LockContents = False

    Yet it still claims that the current area is locked for editing

    Any help would be appreciated.

    Thanks,

    DC


    • Edited by DailyCarrot Thursday, December 8, 2016 12:38 PM
    Thursday, December 8, 2016 12:37 PM

All replies

  • Hi DailyCarrot,

    if we see the code then it's looks like it is not a complete code.

    please try to confirm about it and if it is not complete then try to post the whole code.

    because the error number and the error message you had mentioned in the post is different.

    please visit the link mentioned below.

    You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word .

    Run-time error '4605':
    This method or   property is not available because a document window is not active.

    so before you run the code make sure that document is active.

    the other cause may be you had put the "Restrict editing" on that part.

    please see the link mentioned below.

    How to lock parts of document in Word?

    also try to perform the step manually and let us know about that it is working manually or not.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 9, 2016 2:39 AM