-
Here is my question. Consider the following code:
Set Wrd = CreateObject("Word.Application")
Wrd.Visible = True
Wrd.WindowState = wdWindowStateMaximized
Wrd.Documents.Open sFile
Set Wrd = Nothing
Here I created a Word object and had it load a particular file. Let's say I want to process the new file after it has been changed/updated by the user. How would I do this? I can't simply process it right after the previous code b/c that would be the original file. I think i need some kind of event that tells me if the file has been saved in the word object.. Any ideas?
thanks guys,
jMan
-
Use a boolean variable to check if the document was modified.
If the user modifies the document the bModified variable would be set to true. Then, upon closing the document you could check the variable and do whatever is necessary to the modified document.
-
<?>
my guess would be to use a timer to check the last
modified date of the file...check it when you first
open your app...store it in a variable and then with
your timer you could check it ever so ofter to see it
the last modified date is different than your variable
....if so then you would run your word code again.
[code]
'date and time last modified
Dim sFile As String
sFile = "c:\my documents\try.txt"
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
MsgBox "Last modification to file: " & fso.GetFile(sFile).DateLastModified
[\code]
Wayne