Option Compare Database
Option Explicit

'---------------------------------------------------------------------------------------
' Module    : OpenApps
' Author    : Patrick Wood
' Purpose   : To open other common Microsoft Applications
'           : The Functions Seek to find the latest version and open it.
'---------------------------------------------------------------------------------------


'--------------------------------------------------------------------------------------- ' Procedure : OpenExcel ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Excel '--------------------------------------------------------------------------------------- ' Public Function OpenExcel() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\EXCEL.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\EXCEL.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\EXCEL.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\EXCEL.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\EXCEL.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\EXCEL.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\EXCEL.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\EXCEL.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\EXCEL.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\EXCEL.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\EXCEL.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\EXCEL.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenExcel = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenExcel of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenOutlook ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Outlook '--------------------------------------------------------------------------------------- ' Public Function OpenOutlook() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenOutlook = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenOutlook of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenWord ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Word '--------------------------------------------------------------------------------------- ' Public Function OpenWord() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\WINWORD.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\WINWORD.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\WINWORD.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\WINWORD.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\WINWORD.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\WINWORD.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\WINWORD.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\WINWORD.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\WINWORD.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\WINWORD.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenWord = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenWord of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OutlookAppointment ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Create New Outlook Appointment '--------------------------------------------------------------------------------------- ' Public Function OutlookAppointment() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE /c IPM.APPOINTMENT", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OutlookAppointment = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OutlookAppointment of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OutlookNewContact ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Create New Outlook Contact '--------------------------------------------------------------------------------------- ' Public Function OutlookNewContact() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE /c IPM.CONTACT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE /c IPM.CONTACT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE /c IPM.CONTACT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE /c IPM.CONTACT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE /c IPM.CONTACT", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE /c IPM.CONTACT", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OutlookNewContact = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OutlookNewContact of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OutlookNewEmail ' Author : Patrick Wood ' Date : 5/26/2014 ' Purpose : Opens a new blank Outlook Email to send '--------------------------------------------------------------------------------------- ' Public Function OutlookNewEmail() As Boolean On Error GoTo ErrHandle 'First we need to find which version of Outlook ' is on the computer. 'We start looking for the latest version first. 'Debug.Print will show the results in the immediate window. Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" ' Open a new Outlook Email to send Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE /c IPM.NOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" ' Open a new Outlook Email to send Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE /c IPM.NOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" ' Open a new Outlook Email to send Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE /c IPM.NOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE /c IPM.NOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE /c IPM.NOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE /c IPM.NOTE", 1) Else blnFail = True Call MsgBox("The Program you tried to open" & _ " was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OutlookNewEmail = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OutlookNewEmail of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenMSPaint ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Microsoft Paint '--------------------------------------------------------------------------------------- ' Public Function OpenMSPaint() As Boolean On Error GoTo ErrHandle ' MSPaint Call Shell("C:\WINDOWS\system32\mspaint.exe", 1) OpenMSPaint = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenMSPaint of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OutlookTask ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Create New Outlook Task '--------------------------------------------------------------------------------------- ' Public Function OutlookTask() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE /c IPM.TASK", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE /c IPM.TASK", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE /c IPM.TASK", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE /c IPM.TASK", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE /c IPM.TASK", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE /c IPM.TASK", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OutlookTask = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OutlookTask of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenInfopath ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Infopath '--------------------------------------------------------------------------------------- ' Public Function OpenInfopath() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\INFOPATH.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\INFOPATH.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\INFOPATH.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\INFOPATH.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\INFOPATH.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\INFOPATH.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\INFOPATH.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\INFOPATH.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\INFOPATH.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\INFOPATH.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\INFOPATH.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\INFOPATH.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenInfopath = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenInfopath of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenPublisher ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Publisher '--------------------------------------------------------------------------------------- ' Public Function OpenPublisher() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\MSPUB.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\MSPUB.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\MSPUB.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\MSPUB.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\MSPUB.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\MSPUB.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\MSPUB.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\MSPUB.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\MSPUB.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\MSPUB.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\MSPUB.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\MSPUB.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenPublisher = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenPublisher of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenPowerPoint ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open PowerPoint '--------------------------------------------------------------------------------------- ' Public Function OpenPowerPoint() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\POWERPNT.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\POWERPNT.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\POWERPNT.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\POWERPNT.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\POWERPNT.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\POWERPNT.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\POWERPNT.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\POWERPNT.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\POWERPNT.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\POWERPNT.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\POWERPNT.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\POWERPNT.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenPowerPoint = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenPowerPoint of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : NewOutlookNote ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Create New Outlook Note '--------------------------------------------------------------------------------------- ' Public Function NewOutlookNote() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\OUTLOOK.EXE /c IPM.STICKYNOTE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then NewOutlookNote = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure NewOutlookNote of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenCalculator ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Calculator '--------------------------------------------------------------------------------------- ' Public Function OpenCalculator() As Boolean On Error GoTo ErrHandle ' Infopath Call Shell("C:\WINDOWS\system32\calc.exe", 1) OpenCalculator = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenCalculator of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenNotepad ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Notepad '--------------------------------------------------------------------------------------- ' Public Function OpenNotepad() As Boolean On Error GoTo ErrHandle ' Infopath Call Shell("C:\WINDOWS\system32\notepad.exe", 1) OpenNotepad = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenNotepad of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenWinExplorer ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Windows Explorer '--------------------------------------------------------------------------------------- ' Public Function OpenWinExplorer() As Boolean On Error GoTo ErrHandle ' Infopath Call Shell("C:\WINDOWS\explorer", 1) OpenWinExplorer = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenWinExplorer of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenOneNote ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open OneNote '--------------------------------------------------------------------------------------- ' Public Function OpenOneNote() As Boolean On Error GoTo ErrHandle Dim blnFail As Boolean If DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE15\ONENOTE.EXE") = True Then Debug.Print "Office 15 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE15\ONENOTE.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE14\ONENOTE.EXE") = True Then Debug.Print "Office 14 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE14\ONENOTE.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE12\ONENOTE.EXE") = True Then Debug.Print "Office 12 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE12\ONENOTE.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE11\ONENOTE.EXE") = True Then Debug.Print "Office 11 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE11\ONENOTE.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE10\ONENOTE.EXE") = True Then Debug.Print "Office 10 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE10\ONENOTE.EXE", 1) ElseIf DoesFileExist("C:\Program Files (x86)\Microsoft Office\OFFICE9\ONENOTE.EXE") = True Then Debug.Print "Office 9 Exists" Call Shell("C:\Program Files (x86)\Microsoft Office\OFFICE9\ONENOTE.EXE", 1) Else blnFail = True Call MsgBox("The Program you tried to open was not found. ", _ vbCritical, " Program Not Found") Debug.Print "Program File Not Found" End If If blnFail = False Then OpenOneNote = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenOneNote of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : OpenIE ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Open Internet Explorer '--------------------------------------------------------------------------------------- ' Public Function OpenIE() As Boolean On Error GoTo ErrHandle ' Internet Explorer Call Shell("C:\Program Files\Internet Explorer\iexplore.exe", 1) OpenIE = True ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure OpenIE of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : ReportFileStatus ' Author : Patrick Wood - Gaining Access Technologies - http://gainingaccess.net ' Date : 5/26/2014 ' Purpose : Verify a Report File Exists. ' Arguments : strFilePath is the full Report file path and name. '--------------------------------------------------------------------------------------- ' Public Function ReportFileStatus(strFilePath As String) As String On Error GoTo ErrHandle Dim strMsg As String If Len(Dir(strFilePath)) > 0 Then strMsg = "File exists." Else strMsg = "File doesn't exist." End If ReportFileStatus = strMsg ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure ReportFileStatus of modOpenApps" Resume ExitHere Resume End Function
'--------------------------------------------------------------------------------------- ' Procedure : DoesFileExist ' DateTime : 5/26/2014 ' Author : Patrick Wood http://gainingaccess.net ' Purpose : Determine if a specific File exists of any file type ' Arguments : strFileNamePath is the full path and file name: ' Usage : DoesFileExist("C:\MyFiles\MyFileName.txt") ' : In a Procedure: If DoesFileExist(strfname) Then . . . '--------------------------------------------------------------------------------------- ' Function DoesFileExist(strFileNamePath As String) As Boolean On Error GoTo ErrHandle If Len(Dir(strFileNamePath)) > 0 Then DoesFileExist = True Else DoesFileExist = False End If ExitHere: Exit Function ErrHandle: MsgBox "Error " & Err.Number & " " & Err.Description _ & vbCrLf & "In Procedure DoesFileExist of modOpenApps" Resume ExitHere Resume End Function