Results 1 to 1 of 1
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Backup before save (Word 2000)

    I wanted some simple code to leave an audit trail of documents (I'm cloning documents to make a web page,
    and occasionally forget to issue a File, saveAs in my excitement to make a clone of a document).
    I have a global Add-in (MRUse) which traps various events, including macros for FileSave and FilesaveAs.
    This appears to work for me. I have attached three procedures.
    The procedure "Versionize" (below) attempts to leave a succession of date/time named files in the AutoRecover folder.
    I use a switch (os.blnVersioning) in a global structure that determines if versions are required.
    See also <post:=645,950>post 645,950</post:>

    <pre>Public Function Versionize(doc As Document)
    ''' If at all posisble, save a date-time stamped version of the document before continuing.
    If Len(doc.Path) > 0 Then ' the document is previously saved
    Dim strFullname As String
    strFullname = doc.FullName
    Dim strAuditTrail As String
    strAuditTrail = UW.strFixPath(Options.DefaultFilePath(Path:=wdAuto RecoverPath))
    strAuditTrail = strAuditTrail & Format(Now(), "YYYYMMDD_hhmmss")
    strAuditTrail = strAuditTrail & ".doc"
    doc.SaveAs (strAuditTrail)
    doc.SaveAs (strFullname)
    Else
    strAuditTrail = UW.strFixPath(Options.DefaultFilePath(Path:=wdAuto RecoverPath))
    strAuditTrail = strAuditTrail & Format(Now(), "YYYYMMDD_hhmmss")
    strAuditTrail = strAuditTrail & ".doc"
    doc.SaveAs (strAuditTrail)
    Call FileSaveAs
    End If
    End Function</pre>

    Attached Files Attached Files

Posting Permissions

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