View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Cormorin[_2_] Cormorin[_2_] is offline
external usenet poster
 
Posts: 1
Default Macro for Excel / Outlook

HI

I have my first attempt see below:

Sub SidewearTask()

Dim olApp As Outlook.Application
Dim olTsk As TaskItem
Dim cell As Range
'Dim olRec As Outlook.RecurrancePattern

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Body = Range("B6") & " " & Range("C6") & " " & Range("M6") &
" & Range("E6") & "M" & Range("F6") & "CH" & " " & Range("G6") & "M"
Range("H6") & "CH"
.Subject = "Sidewear Inspection"
.DueDate = Range("K6")
'Set olRec = Range("J6")
'.Set olRec = .GetRecurrancePattern
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub


Two main issues:
1) Not sure how to set the recurrance as I do not understand the
olrec line. Also the column with the recurrance (col. J) is as follow
24M for 2yearly 12M for yearly etc..

2) If I have to create the above for each record it will take nearly a
long as creating all the tasks manually. Is there a way to do it in
loop to same repaet until record in column B is blank ie the end of th
work sheet ?

Thanks

Mike

Oh and a third

3) the subject box should read the same as the tab (sheet name

--
Message posted from http://www.ExcelForum.com