I am attempting to create an install file.
There are some users using Outlook 2003 and others using Outlook 2010. The macro ensures the msoutl.olb is installed for both versions. But I can't get the CopyFile Command to work without erroring out.
All paths are correct and I have admin rights to all files/folders...
Option Explicit
Function fCopy(sFile, dFile)
Dim xlObj As Object
Set xlObj = CreateObject("Scripting.FileSystemObject")
xlObj.CopyFile sFile, dFile, True
Set xlObj = Nothing
End Function
Sub Control_Install()
Dim SrceFile As String, SrceFile1 As String
Dim DestFile As String, DestFile1 As String
If Len(Dir("c:\program files\microsoft office\office11", vbDirectory)) = 0 Then
MkDir "c:\program files\microsoft office\office11"
Else
End If
If Len(Dir("c:\program files\microsoft office\office14", vbDirectory)) = 0 Then
MkDir "c:\program files\microsoft office\office14"
Else
End If
SrceFile = "p:\work comp\tog analysis controls\office11\msoutl.olb"
SrceFile1 = "p:\work comp\tog analysis controls\office14\msoutl.olb"
DestFile = "c:\program files\microsoft office\office11\msoutl.olb"
DestFile1 = "c:\program files\microsoft office\office14\msoutl.olb"
Call fCopy(SrceFile, DestFile)
Call fCopy(SrceFile1, DestFile1)
End Sub
Bookmarks