A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

what reference do i need. why error



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 6th 08, 02:52 AM posted to microsoft.public.outlook.program_vba
Dickery1
external usenet poster
 
Posts: 6
Default what reference do i need. why error

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
Ads
  #2  
Old March 6th 08, 03:44 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default what reference do i need. why error

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.outlookcode.com/article.aspx?id=54


"Dickery1" wrote in message ...
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

  #3  
Old March 6th 08, 12:01 PM posted to microsoft.public.outlook.program_vba
Dickery1
external usenet poster
 
Posts: 6
Default what reference do i need. why error

On Mar 5, 9:44*pm, "Sue Mosher [MVP-Outlook]"
wrote:
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.outlookcode.com/article.aspx?id=54



"Dickery1" wrote in ...
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- Hide quoted text -


- Show quoted text -


thanks
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarter NameSpace Reference... DG Outlook and VBA 1 October 21st 07 03:26 PM
Reference book recommendation? cmw Outlook and VBA 1 May 3rd 07 06:57 PM
Getting rid of reference to deleted program. Larry S. Add-ins for Outlook 1 July 31st 06 03:15 PM
Change VBA Reference from PST to OST File Karl Burrows Outlook and VBA 1 July 18th 06 03:54 PM
Reference Formula ~KO Outlook - Using Forms 3 February 24th 06 09:20 PM


All times are GMT +1. The time now is 08:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.