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();

Re: document active but not really? by aidan

aidan
Thu Jun 01 09:16:42 CDT 2006

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!
matt@eary.net wrote:
> 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();


Re: document active but not really? by matt

matt
Thu Jun 01 13:36:26 CDT 2006

Oh, I just assumed Save As would close the file. It's better now,
thanks!