简体   繁体   中英

How to open word file in background using vb.net?

I am working on creating multiple documents from source document.

I am using:

objWordApp.Documents.Open("D:\Template\Aptletter.doc")

I modify the above document and save in another folder.

While creating documents, word files are opening and closing multiple times. So user unable to do another work on the same PC.

How to stop open file or Is there any method to modify document without above method?

So please suggest

Thanks in Advance

DEV

The visibility of a word document being controlled via interop can be set using the WordApplication.Visible attribute.

This attribute is, as you can see, at the Application level. If you've already opened a document using that WordApplication , you can't suddenly make the application invisible using the attribute.

What you can do, though, is create another instance of WordApplication . Call it InvisibleWordApplication for clarity, and set InvisibleWordApplication.Visible = false right from the start. Then open your document using that application, and you should be set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM