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

Auto Run a macro or sub on task open



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 22nd 08, 03:38 PM posted to microsoft.public.outlook.program_vba
LWD3
external usenet poster
 
Posts: 2
Default Auto Run a macro or sub on task open

I have the following sub that works off a button from the tool bar.

Public Sub subInsertDate()
Dim itm As Object
Dim strNote As String
On Error Resume Next

Set itm = Application.ActiveInspector.CurrentItem

If Not itm Is Nothing Then
strNote = itm.Body
itm.Body = Date & " - " & vbCrLf & strNote
End If

Set itm = Nothing

End Sub

How do I get this to auto execute when I open a specific task?
Ads
  #2  
Old August 22nd 08, 06:50 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Auto Run a macro or sub on task open



You may use the NewInspector event for that.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Fri, 22 Aug 2008 07:38:01 -0700 schrieb LWD3:

I have the following sub that works off a button from the tool bar.

Public Sub subInsertDate()
Dim itm As Object
Dim strNote As String
On Error Resume Next

Set itm = Application.ActiveInspector.CurrentItem

If Not itm Is Nothing Then
strNote = itm.Body
itm.Body = Date & " - " & vbCrLf & strNote
End If

Set itm = Nothing

End Sub

How do I get this to auto execute when I open a specific task?

 




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
AUTO RUN A MACRO ON OPENING OUTLOOK middoabs Outlook and VBA 5 May 23rd 13 06:16 AM
outlook schedule task (macro) to run weekly. Stew J Outlook and VBA 1 June 2nd 08 06:23 AM
Need Outlook Macro To Auto-Forward New Messages snowmangoh Outlook and VBA 3 September 11th 07 06:34 PM
Macro to open a new Task and assign it a specific category Steve Marshall Outlook and VBA 1 November 9th 06 06:01 AM
** Macro to auto-increment a cell using arrow keys? Jack Outlook and VBA 1 September 28th 06 06:19 AM


All times are GMT +1. The time now is 07:56 AM.


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