PC Review


Reply
Thread Tools Rate Thread

Creating task in outlook from a particular row in excel

 
 
thecelebration@gmail.com
Guest
Posts: n/a
 
      28th Jan 2008
Hello,

I have a workbook with multiple worksheets, and I'd like to be able to
create tasks in Outlook based upon a selected row I highlight.

The worksheets have the same format, which is basically:

Task Name | Due Date | Category | Priority | X
| Y | Z
_________________________________________________________________
feed dog | March 1, 08| Pets | High |
a | b | c
do budget | March 9, 08| Finance | low |
a | b | c
fix car | May 3, 08 | Car | Med
| a | b | c


Now, I havent coded in VB before or created script in Excel...So was
curious if anyone has this already created and i can import easily.
Ideally would be great if there was a way i could highlight a row
above and then press a button at top which creates the outlook task.

any guidance appreciated!

thanks
s
 
Reply With Quote
 
 
 
 
Steve Yandl
Guest
Posts: n/a
 
      28th Jan 2008
Try something like this:

______________________________________

Sub TaskFromThisRow()
Const olFolderTasks = 13
Dim r As Integer
Dim P As Integer

r = ActiveCell.Row

Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
Set olFolder = ns.GetDefaultFolder(olFolderTasks)

Set taskItem = olFolder.Items.Add
With taskItem
.Subject = ActiveCell.Worksheet.Cells(r, 1).Value
.DueDate = ActiveCell.Worksheet.Cells(r, 2).Value
.Categories = ActiveCell.Worksheet.Cells(r, 3).Value
If UCase(ActiveCell.Worksheet.Cells(r, 4).Value) = "HIGH" Then
P = 2
ElseIf UCase(ActiveCell.Worksheet.Cells(r, 4).Value) = "LOW" Then
P = 0
Else
P = 1
End If
.Importance = P
.Save
End With

Set taskItem = Nothing
Set ns = Nothing
Set ol = Nothing
End Sub

_______________________________________


Steve



<(E-Mail Removed)> wrote in message
news:dfcb5995-38c7-47be-891d-(E-Mail Removed)...
> Hello,
>
> I have a workbook with multiple worksheets, and I'd like to be able to
> create tasks in Outlook based upon a selected row I highlight.
>
> The worksheets have the same format, which is basically:
>
> Task Name | Due Date | Category | Priority | X
> | Y | Z
> _________________________________________________________________
> feed dog | March 1, 08| Pets | High |
> a | b | c
> do budget | March 9, 08| Finance | low |
> a | b | c
> fix car | May 3, 08 | Car | Med
> | a | b | c
>
>
> Now, I havent coded in VB before or created script in Excel...So was
> curious if anyone has this already created and i can import easily.
> Ideally would be great if there was a way i could highlight a row
> above and then press a button at top which creates the outlook task.
>
> any guidance appreciated!
>
> thanks
> s



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Outlook Task from Excel Bugman Microsoft Excel Programming 0 17th Jan 2008 02:26 PM
Use custom task form in Outlook 2003 when creating task in ON 2007 Bobby C Microsoft Access 1 1st Jan 2008 05:39 PM
Creating a task in Outlook from a date in Excel =?Utf-8?B?SmFtaWVAV2lsZGNhcmQ=?= Microsoft Excel Misc 4 3rd Jul 2007 04:54 PM
Creating a task in outlook =?Utf-8?B?UGFzdHk=?= Microsoft Excel Programming 0 23rd Mar 2007 02:07 PM
Creating an Outlook Task Keith Microsoft Access Form Coding 1 21st Sep 2003 03:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:44 PM.