Word.OfficeUI sync between iMac and Windows

New Daddy
4StarLounger
Posts: 437
Joined: 05 Nov 2012, 20:02

Word.OfficeUI sync between iMac and Windows

Post by New Daddy »

The macro below triggers an error in OSX. Could someone point out what changes need to be made for OSX?
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

User avatar
HansV
Administrator
Posts: 78594
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Word.OfficeUI sync between iMac and Windows

Post by HansV »

The code uses several functions and locations that are specific to Windows; I don't know what - if any - the equivalents for Mac OS are, sorry.
Best wishes,
Hans