G
GlenD
I get a vbscript error at the point indicated in the code below and can
not seem to figure out what the correction should be. Vbscript
debugger only indicates an error at this line number nothing more.
Thanks
Glen
Function Item_Open()
' PublishAsForm
Dim oMapi
Dim oFolder
Dim oApp
Dim myItem
Dim myDate
Set oApp = CreateObject("Outlook.Application")
Set oMapi = Application.GetNamespace("MAPI")
Set oFolder = oApp.ActiveExplorer.CurrentFolder
Item.UserProperties.Find("ItemsInInbox") = oFolder.Items.Count
Item.UserProperties.Find("FoldersInInbox") = oFolder.Folders.Count
Item.UserProperties.Find("UnReadItemInInbox")= oFolder.UnReadItemCount
Set myItem = oFolder.Items(2)
-----> error here myDate = FormatDateTime(myItem.ReceivedTime,2)
Item.UserProperties.Find("InboxOldestUnReadItem") = myDate
MsgBox " Current folder is - " & oFolder.Name & ". It has " &
CStr(oFolder.Folders.Count) & " folders in it"
MsgBox " and " & oFolder.Name & " has " & CStr(oFolder.Items.Count)
& " in it."
MsgBox " of which " & CStr(oFolder.UnReadItemCount) & " items are
unread" & " and item(1) has a recieved time of " & myDate
mIsLoaded = -1
End Function
not seem to figure out what the correction should be. Vbscript
debugger only indicates an error at this line number nothing more.
Thanks
Glen
Function Item_Open()
' PublishAsForm
Dim oMapi
Dim oFolder
Dim oApp
Dim myItem
Dim myDate
Set oApp = CreateObject("Outlook.Application")
Set oMapi = Application.GetNamespace("MAPI")
Set oFolder = oApp.ActiveExplorer.CurrentFolder
Item.UserProperties.Find("ItemsInInbox") = oFolder.Items.Count
Item.UserProperties.Find("FoldersInInbox") = oFolder.Folders.Count
Item.UserProperties.Find("UnReadItemInInbox")= oFolder.UnReadItemCount
Set myItem = oFolder.Items(2)
-----> error here myDate = FormatDateTime(myItem.ReceivedTime,2)
Item.UserProperties.Find("InboxOldestUnReadItem") = myDate
MsgBox " Current folder is - " & oFolder.Name & ". It has " &
CStr(oFolder.Folders.Count) & " folders in it"
MsgBox " and " & oFolder.Name & " has " & CStr(oFolder.Items.Count)
& " in it."
MsgBox " of which " & CStr(oFolder.UnReadItemCount) & " items are
unread" & " and item(1) has a recieved time of " & myDate
mIsLoaded = -1
End Function