document active but not really?

M

matt

I'm using C#. I've created a new document and saved it with SaveAs.
Now I want to re-open the same document and allow the user to edit it,
so I do Open and then Activate. Then Word's in this odd state with the
correct filename in the title bar and the menus appear as if a file is
open & active, but the document isn't showing! If I go to the Window
menu, the document's there (the only one there) and it's checked, but
if I click on it, Word's document area stays empty (blue/grey).

The code excerpt is below. Thanks for any ideas!

Matt
oWordDoc.SaveAs(ref WordFileName, ref
Missing, ref Missing,
ref Missing, ref oTrue, ref Missing,
ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing,
ref Missing);

// re-open it for user to continue editing
oWordDoc = oWordApp.Documents.Open(ref
WordFileName, ref Missing, ref Missing,
ref oTrue, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref oTrue,
ref Missing, ref Missing, ref Missing,
ref Missing);

oWordDoc.Activate();
 
A

aidan.heritage

Why are you trying to open the file - SaveAs saves it but keeps it open
in Word - I suspect this may be the problem that trying to open an
already open file is sending Word into a frenzy of continuous looping!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top