Reputation: 143
I'm filling a word document with data of a db.
Now I'm using this.Application.Documents.Add();
to get a Word.Document Object and manipulate it.
This object is shown in the Word instance.
The issue is to get a Word.Document Object, which I can manipulate and save in background.
So after the dataprocessing is done, I can open it in the Word instance.
Upvotes: 0
Views: 424
Reputation: 35400
Documents.Add() function has an optional parameter named Visible
. You can pass false to this argument and your document will not be shown in the Word instance. You can still manipulate this document through code just like normal documents. After you're done with your stuff, call Document.Save()
to save it to disk. Thereupon you can open it in visible mode as and when needed.
Upvotes: 1