Outlook 2k3 Script: Exporting Task item to Excel

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hi all,

I want to export all my task (from date 1 to date 2) to an Excel File
programmaticaly using Outlook vbs

It's a personal Form with personal Fields, when I use the standard outlook
export some items are not present and Other (unusefull) are there, I use
some object like mileage to put the item Id and in this case my Excel file
is unusable

I don't know where to start and wonder if some one can help

Tks
 
M

Michael Bauer [MVP - Outlook]

First, from Outlook that should be done with VBA, not VBS. Add a ref to
Excel (Tools/references) to your project. Then you can see Excel´s methods,
objects etc. in the Object Browser (F2), too. Switch there from <All
Libraries> to Outlook or Excel to explore the opportunities.

Excel library: Create a new workbook with Workbooks.Add function, from that
objetc get a ref to the first worksheet (Workbook.Sheets(1)).

Outlook library: With the Restrict function you can get the items from date
1 to date 2. Then loop through that collection and copy what you want to
into the worksheet.

For writing data into a worksheet´s first cell use its Range object:
Range("a1").Value = "data". The next field could be written then by using
the Offset function, which also returns a Range object.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Am Fri, 3 Nov 2006 16:34:24 +0100 schrieb news.microsoft.com:
 
B

bbnimda

What about if I put all my collected data in a task body and separate them
with << ; >> than save this body to cvs file ?

Do you think It's possible ? if yes how can I save the content of body to
a File ?

Thks
 
M

Michael Bauer [MVP - Outlook]

Instead of WriteFile you can use the Microsoft Scripting Runtime. Its
FileSystemObject has a CreateTextFile function. You can explore the
functions yourself with the Object Browser in the VBA environment.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --



Am Mon, 6 Nov 2006 14:11:58 +0100 schrieb news.microsoft.com:
Hi,


ReadFile and WriteFile are not allowed in Outlook Script....



Michael Bauer said:
A few days ago I posted a sample here:
http://groups.google.de/group/micro...a745c?lnk=st&q=&rnum=2&hl=de#bc4c114474fa745c

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Am Sat, 4 Nov 2006 10:30:03 +0100 schrieb bbnimda:
What about if I put all my collected data in a task body and separate them
with << ; >> than save this body to cvs file ?

Do you think It's possible ? if yes how can I save the content of body to
a File ?

Thks


"Michael Bauer [MVP - Outlook]" <[email protected]> a ?it dans le message de
[email protected]...

First, from Outlook that should be done with VBA, not VBS. Add a ref to
Excel (Tools/references) to your project. Then you can see Excel´s
methods,
objects etc. in the Object Browser (F2), too. Switch there from <All
Libraries> to Outlook or Excel to explore the opportunities.

Excel library: Create a new workbook with Workbooks.Add function, from
that
objetc get a ref to the first worksheet (Workbook.Sheets(1)).

Outlook library: With the Restrict function you can get the items from
date
1 to date 2. Then loop through that collection and copy what you want to
into the worksheet.

For writing data into a worksheet´s first cell use its Range object:
Range("a1").Value = "data". The next field could be written then by
using
the Offset function, which also returns a Range object.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Am Fri, 3 Nov 2006 16:34:24 +0100 schrieb news.microsoft.com:

Hi all,

I want to export all my task (from date 1 to date 2) to an Excel File
programmaticaly using Outlook vbs

It's a personal Form with personal Fields, when I use the standard
outlook
export some items are not present and Other (unusefull) are there, I use
some object like mileage to put the item Id and in this case my Excel
file
is unusable

I don't know where to start and wonder if some one can help

Tks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top