gul7911 Posted August 6, 2004 Posted August 6, 2004 Hi all I am doing MS Word automation with VB.NET. I am getting some text from word and writing back in word after changing its format. But during this process I lost the control of my application. For example I have added a button on my form so that i can stop the automation process in middle. But I can not press this button, because during automation process I lost the control of my application. regards, Atif Quote
*Experts* mutant Posted August 6, 2004 *Experts* Posted August 6, 2004 The process prevents your application from receiving messages that would allow it to update itself and its controls, probably because writing to the word file is resource intensive. If you are writing the file in a loop (I never worked with Office automation so I have no idea how it works) then stick Application.DoEvents() somewhere to allow your application to receive messages and update itself. If you are not doing it in a loop but simply calling some method that will write it all at once, create a new thread and save the file in it, instead of the thread your appliaction is running in. (If you need an example just post) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.