sub or function not defined. not sure what to do to fix it.

D

Dickery1

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
 
T

Tony Jollans

I'm not sure what to do to fix it, either.

strText

is, presumably, the line that causes the problem. What do you think it
should do?
 
A

Andy Pope

Hi,

The error is caused by the strText line. Perhaps you meant to set an initial
value for the variable.
Also your End statement should probably be End If

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top