G
Geoff Schwab
Greetings,
I am a newby to Project VB but I have a development background. I have
written some macros that take my projects and filter them by resource and
milestone (filter out tasks not assigned to the resource and are not a
milestone), then spit out gif images based on date ranges for our
milestones.
This works well except that the gifs show all tasks (I select all tasks)
rather than the tasks that are relevant to the date range of the milestone.
I would like to somehow either only select the tasks within that date range
or apply a second filter (as far as I can tell only one filter works at a
time) that would specifiy the date range to be printed.
I tried a "hack" where I created a filter for each resource that would
filter tasks that are not assigned to that resource and not in a specified
date range. For some reason, Project only displayed the resource's first
task so I tried an even simple example:
FilterApply name:="Date &Range...", Value1:="5/14/04", Value2:="6/17/04"
This still filters everything but each resource's first task in that range.
Of course, when you apply the filter from Project's Project->Filter For menu
it works fine. Looks like a bug to me!
Any ideas or better ways to accomplish this?
Basically what I want to do is:
1. Filter all tasks that are not either assigned to a specific resource or a
milestone (works fine)
2. And filter all tasks not in a specified date range or select all tasks
within the range (cannot get it to work)
3. Print a gif of the selected tasks (works fine)
My basic code loop looks like:
' Loop for each resource
For I = 0 To 3
' Loop for each milestone date range
For j = 0 To 16
Dim saveName As String
saveName = "C:\blah\" + Names(I) + "_M" + Format(j + 1) + ".gif"
If fs.FileExists(saveName) Then
fs.DeleteFile filespec:=saveName, force:=True
End If
' My custom filter
FilterApply name:="Milestones and Resource", Highlight:=False,
Value1:=Names(I)
Sort Key1:="Finish", Outline:=False
' This is what I need to fix (should only select tasks in the
date range)
SelectTaskColumn Column:="Name"
EditCopyPicture Object:=False, ForPrinter:=2, SelectedRows:=1,
FromDate:=dates(j * 2), ToDate:=dates(j * 2 + 1), fileName:=saveName,
ScaleOption:=pjCopyPictureShowOptions
Next
Next
Thanks,
Geoff
I am a newby to Project VB but I have a development background. I have
written some macros that take my projects and filter them by resource and
milestone (filter out tasks not assigned to the resource and are not a
milestone), then spit out gif images based on date ranges for our
milestones.
This works well except that the gifs show all tasks (I select all tasks)
rather than the tasks that are relevant to the date range of the milestone.
I would like to somehow either only select the tasks within that date range
or apply a second filter (as far as I can tell only one filter works at a
time) that would specifiy the date range to be printed.
I tried a "hack" where I created a filter for each resource that would
filter tasks that are not assigned to that resource and not in a specified
date range. For some reason, Project only displayed the resource's first
task so I tried an even simple example:
FilterApply name:="Date &Range...", Value1:="5/14/04", Value2:="6/17/04"
This still filters everything but each resource's first task in that range.
Of course, when you apply the filter from Project's Project->Filter For menu
it works fine. Looks like a bug to me!
Any ideas or better ways to accomplish this?
Basically what I want to do is:
1. Filter all tasks that are not either assigned to a specific resource or a
milestone (works fine)
2. And filter all tasks not in a specified date range or select all tasks
within the range (cannot get it to work)
3. Print a gif of the selected tasks (works fine)
My basic code loop looks like:
' Loop for each resource
For I = 0 To 3
' Loop for each milestone date range
For j = 0 To 16
Dim saveName As String
saveName = "C:\blah\" + Names(I) + "_M" + Format(j + 1) + ".gif"
If fs.FileExists(saveName) Then
fs.DeleteFile filespec:=saveName, force:=True
End If
' My custom filter
FilterApply name:="Milestones and Resource", Highlight:=False,
Value1:=Names(I)
Sort Key1:="Finish", Outline:=False
' This is what I need to fix (should only select tasks in the
date range)
SelectTaskColumn Column:="Name"
EditCopyPicture Object:=False, ForPrinter:=2, SelectedRows:=1,
FromDate:=dates(j * 2), ToDate:=dates(j * 2 + 1), fileName:=saveName,
ScaleOption:=pjCopyPictureShowOptions
Next
Next
Thanks,
Geoff