![]() ![]() Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As ) Handles BackgroundWorker1. ProgressBar1.Value = e.ProgressPercentage Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As ) Handles BackgroundWorker1.ProgressChanged ![]() Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As ) Handles BackgroundWorker1.DoWorkĭim path As String = FolderBrowserDialog1.SelectedPathĭim files() As String = System.IO.Directory.GetFiles(path, "*.doc", SearchOption.AllDirectories)ĭim FileToSaveAsWord As String = f.ToStringįor Each bm As Word.Bookmark In odoc.Bookmarks Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Output), a Progress Bar, and 2 Buttons (Start and Cancel). ![]() This exception is only raised if a debugger is attached to the process.īelow is my code hope some one can help me !!!!! NET framework provides a simple way to get started in threading with the. ![]() Ensure that your Main function has STAThreadAttribute marked on it. I have written a vb.net applicattion that can access folders containing word files and remove the bookmarks, and its working just great, but as long as the application is working the form is freezing, now when I add the background worker and the progressīar im getting an error message stating :Ĭurrent thread must be set to single thread apartment (STA) mode before OLE calls can be made. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |