Hi adi,
>how can i know when a document finished loading after openning?
>(using c#)
why do you want to know that?
Has it to do with code in an auto-macro?
A workaraound like the following might help,
for small documents.
Sub AutoExec()
'or autoopen or autonew or semething of that kind
Application.OnTime _
When:=Now + TimeValue("00:00:02"), _
Name:="continue"
End Sub
sub continue
' whatever
end sub
Or maybe something like this, which works even for
a 1000 pages document:
Option Explicit
Dim p1 As Long
Dim p2 As Long
Sub autoopen()
Selection.EndKey unit:=wdStory
p1 = Selection.Information(wdActiveEndPageNumber)
continue
End Sub
Sub continue()
p2 = Selection.Information(wdActiveEndPageNumber)
If p1 = p2 Then
MsgBox "ready"
Else
autoopen
End If
End Sub
Just to show a possible way, a workaraound.
With c#, you should be able to check wether
the process "WINWORD.EXE" is idle.
Helmut Weber - 27 Dec 2005 22:14 GMT

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
adi - 28 Dec 2005 13:35 GMT
hi,
what i'm trying to do is run a tester that check files in different sizes in
order to get the loading time of documents with different sizes...
i created many files and i'm trying to run the tester on those files, open
each of them and get its time...
> Hi adi,
>
[quoted text clipped - 44 lines]
> With c#, you should be able to check wether
> the process "WINWORD.EXE" is idle.
Helmut Weber - 28 Dec 2005 14:16 GMT
Hi Adi,
how about this guess (!), that after repagination
has been finished a document has been fully loaded?
Option Explicit
Dim p1 As Long
Dim p2 As Long
Dim t As Long
Public Declare Function GetTickCount Lib "kernel32" () As Long
Sub autoopen()
t = GetTickCount
Selection.EndKey unit:=wdStory
p1 = Selection.Information(wdActiveEndPageNumber)
continue
End Sub
Sub continue()
Selection.EndKey unit:=wdStory
p2 = Selection.Information(wdActiveEndPageNumber)
If p1 = p2 Then
MsgBox GetTickCount - t
Else
autoopen
End If
End Sub
HTH

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
adi - 28 Dec 2005 16:01 GMT
nice idea
i will try that
thanks! :)
> Hi Adi,
>
[quoted text clipped - 24 lines]
>
> HTH