This was such a useful macro for me in Windows.
HansV wrote:The following is untested, test carefully and make a backup copy of Word.officeUI first. I don't think you'll be able to run the code from Word or when Word is active, for I suspect that Word.officeUI will be locked. So you could try running it from Excel, for example, after closing Word.
Code: Select all
Sub Test() Dim fso As Object Dim strProfile As String Dim strPath1 As String Dim strPath2 As String Dim fil1 As Object Dim fil2 As Object Set fso = CreateObject("Scripting.FileSystemObject") strProfile = Environ("UserProfile") strPath1 = strProfile & "\DropBox\Word.officeUI" Set fil1 = fso.GetFile(strPath1) strPath2 = strProfile & "\AppData\Local\Microsoft\Office\Word.officeUI" Set fil2 = fso.GetFile(strPath2) If fil1.DateLastModified < fil2.DateLastModified Then fso.CopyFile strPath2, strPath1, True ElseIf fil1.DateLastModified > fil2.DateLastModified Then fso.CopyFile strPath1, strPath2, True End If End Sub