Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CSV files, ASCII characters, and Outlook Tasks Lists...oh my!
OK, here's what I am trying to do...I am exporting an Outlook Task list to a
CSV file, which I am then opening in Excel and reformatting to make it all pretty. I did some research here in this group earlier and found out how to get rid of the "hard-returns" that show up as little boxes in the cells. The problems arise because some of the cells have way too many characters and the macro stops running when it hits them. If I go in and manually delete about 1/2 the contents of the cell (which is VERY long - it's the Notes from the Outlook task list and can be many many lines of data) it will work. How do I truncate the data in the cells, or what can I do to resolve this problem? Any help would be appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
CSV files, ASCII characters, and Outlook Tasks Lists...oh my!
From VBA in Excel, it's possible to access the Outlook Tasks folder and
extract or edit the individual properties of a TaskItem without having to use a csv file as an intermediary. There are 50 or 60 properties a TaskItem can have so this could be a somewhat cumbersome programming project but if you only fill in a dozen or so of the available fields when creating tasks, it might be a better way to go. If it still makes more sense to export to csv and simply open the csv file in Excel, you could write a routine to iterate through all the TaskItems and truncate the Notes if the text string exceeds a threshold. Is the ultimate plan to send the tasks back to Outlook or were you just trying to create a report outside of Outlook where it would be easier to see what you had been working on? Steve Yandl "paularo" wrote in message ... OK, here's what I am trying to do...I am exporting an Outlook Task list to a CSV file, which I am then opening in Excel and reformatting to make it all pretty. I did some research here in this group earlier and found out how to get rid of the "hard-returns" that show up as little boxes in the cells. The problems arise because some of the cells have way too many characters and the macro stops running when it hits them. If I go in and manually delete about 1/2 the contents of the cell (which is VERY long - it's the Notes from the Outlook task list and can be many many lines of data) it will work. How do I truncate the data in the cells, or what can I do to resolve this problem? Any help would be appreciated! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
CSV files, ASCII characters, and Outlook Tasks Lists...oh my!
Steve,
No, the ultimate plan is to e-mail it to someone else as an update on projects in the works. I have a great macro that makes it all pretty, but it just keeps hanging up on the really long data strings in some of the "notes" cells. I just want to shorten them to a hundred characters or so, and truncate the rest. Paula "Steve Yandl" wrote: From VBA in Excel, it's possible to access the Outlook Tasks folder and extract or edit the individual properties of a TaskItem without having to use a csv file as an intermediary. There are 50 or 60 properties a TaskItem can have so this could be a somewhat cumbersome programming project but if you only fill in a dozen or so of the available fields when creating tasks, it might be a better way to go. If it still makes more sense to export to csv and simply open the csv file in Excel, you could write a routine to iterate through all the TaskItems and truncate the Notes if the text string exceeds a threshold. Is the ultimate plan to send the tasks back to Outlook or were you just trying to create a report outside of Outlook where it would be easier to see what you had been working on? Steve Yandl "paularo" wrote in message ... OK, here's what I am trying to do...I am exporting an Outlook Task list to a CSV file, which I am then opening in Excel and reformatting to make it all pretty. I did some research here in this group earlier and found out how to get rid of the "hard-returns" that show up as little boxes in the cells. The problems arise because some of the cells have way too many characters and the macro stops running when it hits them. If I go in and manually delete about 1/2 the contents of the cell (which is VERY long - it's the Notes from the Outlook task list and can be many many lines of data) it will work. How do I truncate the data in the cells, or what can I do to resolve this problem? Any help would be appreciated! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
CSV files, ASCII characters, and Outlook Tasks Lists...oh my!
Paula,
You can run the sub below from Excel, it will go through all the tasks in the Outlook default tasks folder and trim the Notes section to the 100 leftmost characters if there happen to be more than 100 characters in Notes (the Body property of the TaskItem). Before running, please note that this will actually edit information in your Outlook folder. It might be better to do a direct import into Excel (bypass the csv export step) and trim the string retrieved from Outlook before it ends up in an Excel cell so that you would retain the intact taskitems in Outlook. '--------------------------------------------- Sub TrimTaskNotes() Const olFolderTasks = 13 Set ol = CreateObject("Outlook.Application") Set ns = ol.GetNamespace("MAPI") Set olFolder = ns.GetDefaultFolder(olFolderTasks) For Each myTask In olFolder.Items If TypeName(myTask) = "TaskItem" Then If Len(myTask.Body) 200 Then myTask.Body = Left(myTask.Body, 200) myTask.Save End If End If Next myTask Set olFolder = Nothing Set ns = Nothing Set ol = Nothing End Sub '--------------------------------------------- Steve Yandl "paularo" wrote in message ... Steve, No, the ultimate plan is to e-mail it to someone else as an update on projects in the works. I have a great macro that makes it all pretty, but it just keeps hanging up on the really long data strings in some of the "notes" cells. I just want to shorten them to a hundred characters or so, and truncate the rest. Paula "Steve Yandl" wrote: From VBA in Excel, it's possible to access the Outlook Tasks folder and extract or edit the individual properties of a TaskItem without having to use a csv file as an intermediary. There are 50 or 60 properties a TaskItem can have so this could be a somewhat cumbersome programming project but if you only fill in a dozen or so of the available fields when creating tasks, it might be a better way to go. If it still makes more sense to export to csv and simply open the csv file in Excel, you could write a routine to iterate through all the TaskItems and truncate the Notes if the text string exceeds a threshold. Is the ultimate plan to send the tasks back to Outlook or were you just trying to create a report outside of Outlook where it would be easier to see what you had been working on? Steve Yandl "paularo" wrote in message ... OK, here's what I am trying to do...I am exporting an Outlook Task list to a CSV file, which I am then opening in Excel and reformatting to make it all pretty. I did some research here in this group earlier and found out how to get rid of the "hard-returns" that show up as little boxes in the cells. The problems arise because some of the cells have way too many characters and the macro stops running when it hits them. If I go in and manually delete about 1/2 the contents of the cell (which is VERY long - it's the Notes from the Outlook task list and can be many many lines of data) it will work. How do I truncate the data in the cells, or what can I do to resolve this problem? Any help would be appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Outlook Tasks from Excel... | Excel Discussion (Misc queries) | |||
Import tasks from Outlook into Excel | Excel Programming | |||
outlook tasks from comments | Excel Programming | |||
Outlook Automation, Deleting Tasks | Excel Programming |