Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted
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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...