Results 1 to 3 of 3

Thread: Any Ideas on this one?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5
    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

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    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.


  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width