Question

I had tested this code: http://support.microsoft.com/kb/316383

It works, but a Word application is opened and each new paragraph added using VB code is seen one by one(with a small delay). If I want to open and write something using VB, what is the fastest way ? I do not want to view the changes made on word document live. I want to save the document. So will oWord.Visible = False makes it fast ?

Or there is any better way to do this ?

Was it helpful?

Solution

  1. Using the solution from the link http://support.microsoft.com/kb/316383 you could tweak this by not closing your word instance just close the active document at the end and just add new document instead of opening the wordinstance everytime at the beginning. You can automate word to open in invisible mode as different user "OfficeAutomationUser" refer this link for automation of Word (approach which is not recommended by Microsoft) http://theether.net/download/Microsoft/kb/288367.html

  2. As Tim Schmelter said use WordML to manipulate the word documents which is faster and recommended by MS. There are lots of resources over here

http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2011/10/13/getting-started-with-open-xml-development.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top