Thread: [Solved] FileCopy from a check box
View Single Post
 
Old 11-24-2015, 01:58 AM
shabbaranks shabbaranks is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default

Sorted - probably quite long winded but it works

Code:
Private Sub CheckBox1_Click()
Dim strSourceFile As String
Dim StrDestinationFile As String
If Me.CheckBox1 = True Then
strSourceFile = "P:\Test Word Document.docx"
StrDestinationFile = ActiveDocument.Path & "\Test Word Document.docx"
FileCopy strSourceFile, StrDestinationFile
Else
If Me.CheckBox1 = False Then
If Not Dir(ActiveDocument.Path & "\Test Word Document.docx", vbDirectory) = vbNullString Then Kill (ActiveDocument.Path & "\Test Word Document.docx")
End If
End If
End Sub
Reply With Quote