Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim fso, myfile, myfile2, strMessage, strMessage2
strMessage = ""
strMessage2 = ""
Set fso = CreateObject("scripting.FileSystemObject")
Set myfile = fso.CreateTextFile("C:\ON.txt", True)
Set myfile2 = fso.CreateTextFile("C:\OFF.txt", True)
Dim today
today = (Day(Date) & "-" & MonthName(Month(Date), True) & "-" & Right(Year(Date), 2))
Set objApp = GetObject(, "Outlook.Application") '#### Find existing instance of Outlook
If Err Then
' WScript.Quit() '#### If Outlook isn't running, quit the script
Set objApp = CreateObject("Outlook.Application") '#### uncomment this & comment out above line to get data even if Outlook isnt running
End If
Set objOutlook = objApp.GetNameSpace("MAPI")
Set objInboxItems = objOutlook.GetDefaultFolder(6).Items '#### Get inbox folder items
For Each aItem In objInboxItems
If aItem.Subject = "ON SITE MOVEMENT REPORT FOR " & today & "" Then
' strMessage = aItem.Message 'or .Message or .body .text
strMessage = strMessage & vbCr & "NEXT ONE" & vbCr & aItem.body
Else
' If aItem.Subject = "**DIALOG** TAPE OFF SITE MOVEMENT REPORT FOR " & today & "" Then
' strMessage2 = aItem.Message 'or .Message or .body .text
strMessage2 = strMessage2 & vbCr & "NEXT ONE" & vbCr & aItem.body
End If
End If
Next
myfile.Writeline (strMessage)
myfile2.Writeline (strMessage2)
myfile.Close
myfile2.Close
'set objects to nothing
Set objApp = Nothing
Set objOutlook = Nothing
Set objInboxItems = Nothing
Set fso = Nothing
Set myfile = Nothing
Set myfile2 = Nothing