Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 5552 inserting subdoc (XP)

    Has anybody ever gotten the following error when inserting a subdocument via VB automation: "Error 5552: Method '~' of object '~' failed"

    The code is like this:

    ' Set view to outline
    ' Set selection style to "Heading 1"
    objDoc.Subdocuments.AddFromRange Range:=appWord.Selection.Range

    This error happens rarely, and always to a blind user who is using JAWS. I have been able to get a 5552 error by moving the cursor to a non-heading selection and attempting to insert the subdoc, but the error message is "selection does not consist of heading levels". Any thoughts?

    Dan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 5552 inserting subdoc (XP)

    Most of us avoid using master/subdocuments - see Why Master Documents corrupt (but also see <post#=389647>post 389647</post#>)

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 5552 inserting subdoc (XP)

    I'm aware that when you use subdocuments you're living on the edge. However, in this case, I don't see any way around the problem: I need to have certain portions of the document which are locked to editing, and certain portions in which the user can type. If there's another way to do this without using subdocuments, I'm all ears.

    However, in this case, there are no subdocuments in the document at the point where the error occurs. The code is merely attempting to add a subdocument.

    Dan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 5552 inserting subdoc (XP)

    You can divide a document into sections by inserting section breaks, and selectively protect some sections for editing using Tools | Protect Document..., Forms option.

  5. #5
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 5552 inserting subdoc (XP)

    Hans--
    Thanks for the suggestion. However, why does that not create the same problem as described in the article to which you referred me? The article seems to be pointing the blame at the section breaks themselves.

    Dan

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 5552 inserting subdoc (XP)

    As far as I know, section breaks within a document are not particularly dangerous. What makes master/subdocuments unstable is that the master document has to juggle the contents of several documents stored separately, with potentially conflicting settings. What I proposed was keeping everything within one document, with section breaks inserted.

  7. #7
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 5552 inserting subdoc (XP)

    Thanks Hans. I would assume that MS is aware that subdocs are not particularly robust. Have they ever issued any statements about plans to make them more robust?

    Dan

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 5552 inserting subdoc (XP)

    I'm sure they are working on it - the master.subdocument feature become less unstable in recent versions (in Word 95 and 97 it was virtually unusable). But I don't suppose they will ever state something like "it will be fixed in Word 2009". <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •