티스토리 뷰
Private Sub Document_Close()
Application.Quit SaveChanges:=wdSaveChanges, OriginalFormat:=wdWordDocument
'ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
Exit Sub
End Sub
Private Sub Document_Open()
If FileExists("C:\Client\1234.txt") = 1 Then
MsgBox "파일 있음 / 내부", vbInformation, "Security Policy"
Else
MsgBox "파일 없음 / 외부", vbInformation, "Security Policy"
Call Document_Close
End If
End Sub
Function FileExists(ByVal fname As String) As String
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(fname) Then
FileExists = "1"
Else
FileExists = "0"
End If
End Function
'PC&운영체제' 카테고리의 다른 글
[Windows] Robocopy를 사용한 특정 폴더 내 파일 비교 (0) | 2018.01.29 |
---|---|
[플레이어] Windows Media Player CD 음원 복사 방법 (0) | 2018.01.04 |
[mfc140u.dll - 시스템 오류] Virtual Studio Redistributable 패키지 다운로드 (0) | 2017.12.15 |
[Windows 10] 시작메뉴 & 환경변수? (0) | 2017.11.13 |
[Outlook] Inbox(받은편지함)에서 수신 이메일이 사라지는 현상 (0) | 2017.11.03 |