PC Review


Reply
Thread Tools Rate Thread

Creating a new TASK using VFP9.0

 
 
bbettsack
Guest
Posts: n/a
 
      7th May 2010
I know this is a VBA group but I can't seem to get an answer from the VFP
group on this subject. I need to create a new TASK and send it to the person
I pick from a drop-down menu. This has to be done in FOXPRO (VFP9.0-SP2). I
can get to Outlook and create/send an email, but I can not figure out how to
create/send a TASK. Any help/sample code will be great.

Thanks in advance
--
Lost in Tampa
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      7th May 2010
I don't have a clue as to how you'd do it in VFP, but if you are using the
CreateItem() method with an olMailItem argument to create a mail item
substitute the olTaskItem enum member instead.

From there you need to add various properties before you call the Assign()
method of the task. See the VBA object browser help for TaskItem.Assign to
see how to set what you need using VBA code. You will need to translate that
into VFP code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"bbettsack" <(E-Mail Removed)> wrote in message
news:AB771A1D-21D1-4D4E-A1DB-(E-Mail Removed)...
>I know this is a VBA group but I can't seem to get an answer from the VFP
> group on this subject. I need to create a new TASK and send it to the
> person
> I pick from a drop-down menu. This has to be done in FOXPRO (VFP9.0-SP2).
> I
> can get to Outlook and create/send an email, but I can not figure out how
> to
> create/send a TASK. Any help/sample code will be great.
>
> Thanks in advance
> --
> Lost in Tampa


 
Reply With Quote
 
bbettsack
Guest
Posts: n/a
 
      19th May 2010
I figured out the code and am posting it here in case anyone else needs it.

* This program will create a TASK in Outlook (Office 2007)
oOutlook = CreateObject('Outlook.Application')
oNameSpace = oOutlook.GetNameSpace('MAPI')
oNameSpace.Logon()
loItem = oOutlook.CreateItem(3)

#DEFINE CR CHR(13)
WITH loItem
.Subject = 'New Task - test'
.Body = 'Here is the newest TASK that has been assigned to you.'
.Recipients.Add('user@email_address.com')
.StartDate = '05/01/2010'
.DueDate = '05/15/2010'
.ReminderSet = 1
.ReminderTime = CTOT(SYS(10,reminder_date) + ' 09:00')
ENDWITH

loItem.Save()
loItem.Assign()
loItem.Send()
=MESSAGEBOX('TASK Sent.',64,'Status')

--
Lost in Tampa


"Ken Slovak - [MVP - Outlook]" wrote:

> I don't have a clue as to how you'd do it in VFP, but if you are using the
> CreateItem() method with an olMailItem argument to create a mail item
> substitute the olTaskItem enum member instead.
>
> From there you need to add various properties before you call the Assign()
> method of the task. See the VBA object browser help for TaskItem.Assign to
> see how to set what you need using VBA code. You will need to translate that
> into VFP code.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "bbettsack" <(E-Mail Removed)> wrote in message
> news:AB771A1D-21D1-4D4E-A1DB-(E-Mail Removed)...
> >I know this is a VBA group but I can't seem to get an answer from the VFP
> > group on this subject. I need to create a new TASK and send it to the
> > person
> > I pick from a drop-down menu. This has to be done in FOXPRO (VFP9.0-SP2).
> > I
> > can get to Outlook and create/send an email, but I can not figure out how
> > to
> > create/send a TASK. Any help/sample code will be great.
> >
> > Thanks in advance
> > --
> > Lost in Tampa

>
> .
>

 
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 New Task Request in Task Sub-Folders Not Updating =?Utf-8?B?U2VsaW0gTXVoaXVkZGlu?= Microsoft Outlook Discussion 4 15th Dec 2010 05:43 PM
Help Desk and Assigned Help Task Sample not creating task on cliK doc4a Microsoft Outlook Form Programming 0 16th Jul 2008 09:47 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
VFP9 and SQL 2005 using VFP remote view Cannot insert the value NULL into column diane@keynston.co.uk Microsoft ASP .NET 0 31st May 2007 11:05 AM
"Save Task list Order" Keeps popping up when creating task - CEO Must have fixed! Tom Microsoft Outlook Discussion 1 7th Aug 2003 11:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 AM.