O
outlook
Hello, I am retrieving all tasks from Outlook which categories are
"home". But when I run this code and do some changes directly in Outlook
like update progress or change due date,etc., and refresh the Html page,
I don't see those changes in my Html page. I only see them if I rebuild
the all project again. It seems that my local variables are not getting
the last value from Outlook and are keeping the old values.
I will papreciate some suggestions please , thanks
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports System.Web.UI.HtmlTextWriter
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.ComponentModel
Public Class WebForm1
Private _outlook As Outlook.Application
Private _nSpace As Outlook.NameSpace
Private flr As Outlook.MAPIFolder
Private taskFolder As Outlook.MAPIFolder
Private tasks As New Object
Sub gettasks()
Dim strSubject As String
Dim I As Integer
Dim NumItems As Integer
Dim task As New Object
Dim strCategories As String = ""
Dim percentage As Integer = 0
Dim startdate As Date
Dim duedate As Date
Dim strtable As String = ""
Dim stritem As String = ""
_outlook = New Outlook.Application
nspace = _outlook.GetNamespace("MAPI")
taskFolder = nspace.GetDefaultFolder(13)
tasks = taskFolder.Items
NumItems = taskFolder.Items.Count
'if there are no tasks
If NumItems = 0 Then
stritem = "<tr><td>" & """Don't have any tasks.""" &
"</td></tr>"
Response.Write(stritem)
Else
For I = 1 To NumItems
strCategories = UCase(tasks(I).Categories.ToString)
If strCategories = "HOME" Then
strSubject = tasks(I).Subject
percentage = tasks(I).PercentComplete
startdate = tasks(I).StartDate
duedate = tasks(I).duedate
Response.Write(strSubject & "percent: " &
percentage.ToString & " " & FormatDateTime(startdate, vbGeneralDate) +
FormatDateTime(duedate, vbGeneralDate) + "<br>")
End If
Next
End If
_outlook.Quit()
_outlook = Nothing
tasks = Nothing
task = Nothing
End Sub
End Class
"home". But when I run this code and do some changes directly in Outlook
like update progress or change due date,etc., and refresh the Html page,
I don't see those changes in my Html page. I only see them if I rebuild
the all project again. It seems that my local variables are not getting
the last value from Outlook and are keeping the old values.
I will papreciate some suggestions please , thanks
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports System.Web.UI.HtmlTextWriter
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.ComponentModel
Public Class WebForm1
Private _outlook As Outlook.Application
Private _nSpace As Outlook.NameSpace
Private flr As Outlook.MAPIFolder
Private taskFolder As Outlook.MAPIFolder
Private tasks As New Object
Sub gettasks()
Dim strSubject As String
Dim I As Integer
Dim NumItems As Integer
Dim task As New Object
Dim strCategories As String = ""
Dim percentage As Integer = 0
Dim startdate As Date
Dim duedate As Date
Dim strtable As String = ""
Dim stritem As String = ""
_outlook = New Outlook.Application
nspace = _outlook.GetNamespace("MAPI")
taskFolder = nspace.GetDefaultFolder(13)
tasks = taskFolder.Items
NumItems = taskFolder.Items.Count
'if there are no tasks
If NumItems = 0 Then
stritem = "<tr><td>" & """Don't have any tasks.""" &
"</td></tr>"
Response.Write(stritem)
Else
For I = 1 To NumItems
strCategories = UCase(tasks(I).Categories.ToString)
If strCategories = "HOME" Then
strSubject = tasks(I).Subject
percentage = tasks(I).PercentComplete
startdate = tasks(I).StartDate
duedate = tasks(I).duedate
Response.Write(strSubject & "percent: " &
percentage.ToString & " " & FormatDateTime(startdate, vbGeneralDate) +
FormatDateTime(duedate, vbGeneralDate) + "<br>")
End If
Next
End If
_outlook.Quit()
_outlook = Nothing
tasks = Nothing
task = Nothing
End Sub
End Class