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

    'Cannot edit range' error (XP)

    I've got an app which creates two locked subdocuments on opening a document, and then unlocks and erases their ranges upon closing. The code sequence is like this:

    unlock subdoc
    save off the start and end points of its range
    delete subdoc
    delete range using the saved start and end points

    This all works fine in both 2000 and XP. However, when users have an addin called "SmarType" loaded (only in Office XP), it fails when I try to delete the range, with an error 5904: Cannot Edit Range. Does anybody know what could cause this kind of ridiculousness? Or even better, anybody have a suggestion on a workaround (I will accept any hack at this point, no matter how ugly).

    Thanks....

    Dan

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

    Re: 'Cannot edit range' error (XP)

    After much wailing and gnashing of teeth, I blundered into a "fix" of the problem. Instead of deleting the subdocument range, I set it to an empty string:

    set rng = activedocument.subdocuments(1).range
    rng.text = ""

    It's pretty frustrating that there's no rhyme nor reason why this works and the other approach does not in this isolated situation. However, at least the symptoms of the problem have gone away.

    Dan

Posting Permissions

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