Prevent interruptions in ms-word

0

I have a loop which is iterating through words in a word document, but the problem is that a popup shows up that prevents the loop from continuing.

popup that messes up code

^^Is saying the office version is not activated. It will then give the following error

COM Exception: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

I have tried looking through the page class in an effort to find something, but had no luck.

I am using a for loop.

                for (int x = 1; x <= doc.Words.Count - 1; x++) //doc is already set
                {
                     //do what I want
                }

A better question How do I find an already opened ms-word application. I have tried having one open and looking through all the processes and casting it to word.Application, but it didn't work...

c#
loops
ms-word
asked on Stack Overflow Aug 24, 2013 by ismellike • edited Aug 24, 2013 by ismellike

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0