what reference do i need. why error

what reference do i need. why error

Post by Dickery » Fri, 07 Mar 2008 10:52:54



get the following error and am stuck, compile error
sub or function not defined. not sure what to do to fix it.

Sub MovePastDate2Today()
Dim t As TaskItem
Set f =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderTasks)
strText
For Each t In f.Items
If (t.DueDate < DateAdd("d", 2, Now)) Then
strText = strText & (t.t.DueDate)


End


MsgBox strText


Next


On Error GoTo MovePastDate2Today_Error


MovePastDate2Today_Error:
MsgBox "Error " & Err.Number & "(" & Err.Description & ")"


End Sub
 
 
 

what reference do i need. why error

Post by Sue Mosher » Fri, 07 Mar 2008 11:44:42

This is Outlook VBA code? This statement

strText

should be changed to strText = "" or removed completely. In this statement:

strText = strText & (t.t.DueDate)

t.t.DueDate should be t.DueDate and you probably will also want to put some kind of delimiter between the two text expressions.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.yqcomputer.com/

 
 
 

what reference do i need. why error

Post by Dickery » Fri, 07 Mar 2008 20:01:00

On Mar 5, 9:44m, "Sue Mosher [MVP-Outlook]" < XXXX@XXXXX.COM >

> strText> >> > should be changed to strText = "" or removed completely. In this statement:> >> > strText = strText & (t.t.DueDat>) >>
> t.t.DueDate should be t.DueDate and you probably will also want to put some kind of delimiter between the two text expression>. >>
> >-
> Sue Mosher, Outlook M>P
> uthor of Microsoft Outlook 2007 Programmi>g:
> umpstart for Power Users and Administr>tors
> ttp://www.outlookcode.com/article.aspx>id>54> >> >
>

> > get the following error and am stuck, ompile>e>ror
> > sub or function not defined. not sure what to do to f>x >t>
>
> > Sub MovePastDate2T>d>y()
> > Dim t As Ta>k>tem
> > S>t>f =
> > Application.GetNamespace("MAPI").GetDefaultFolder(olFolder>a>ks)
> > s>r>ext
> > For Each t In f>I>ems
> > f (t<DueDate < DateAdd("d", 2, Now>)>Then
> > trText = strText & (t.t.D>eD>t>)
>
> > gt;gt;nd
>
> > sgBo> s>r>ext
> >> > >ext
>
> > On Error GoTo MovePastDate2To>ay>E>ror
>
> > MovePastDate2Tod>y>Error:
> > MsgBox "Error " & Err.Number & "(" & Err.Descript>on>&>")"
>
> > End Sub- Hide quot>d >ext -
>
> - Show quoted text -

thanks