Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Waiting for Document to load

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
C_P - 22 May 2006 19:09 GMT
am creating a word document that basically analyzes other word
documents that contain UAT test resuts (versus putting a button and
code on hundereds of documents).  This should be done in VB.NET or
something along those lines, but licensing is an issue.  My problem
lies when a document is opened up that takes a bit to load but the code

does not wait and executes before it is finished loading, giving
completely bogus results.
Here is the run down:

User selects which file to analyze using a dialog box, which
unfortunately does nothing else:

Application.Dialogs(wdDialogFileOpen).Show

<document starts to load>

<"freezes" document loading and executes code, giving bogus data>

<document finishes loading>

<user gets confused>

I would like a way to wait for the document to finish loading before
the analyzing code is executed.

I have tried using DoEvents in a for loop, such as:

For i = 1 to 50
  DoEvents
Next i

but since the CPU is generally doing nothing, it has virtually no
affect.
....

Thanks!
Jezebel - 22 May 2006 22:52 GMT
Don't know how VB.Net does this, but in ordinary VBA it's like this --

Dim pDoc as Word.Document

Set pDoc = Documents.Open(FileName:=....)
---> this instruction isn't executed until pDoc is opened ...

> am creating a word document that basically analyzes other word
> documents that contain UAT test resuts (versus putting a button and
[quoted text clipped - 33 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.