Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Project

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-2008, 05:25 PM
=?Utf-8?B?dGhlaW50ZXJu?=
 
Posts: n/a
way to test if task exists?

I'm looking for a way to see if any tasks remain once a filter is applied.
if there are tasks, i need to edit their constraints. if not, just keep
going through the code (ideally it would create a picture saying "no tasks
for this resource" but i realize that's probably not realistic.) The
annoyance lies in that if there are no tasks and it tries to edit them, it
ends up inserting an extra row. here are the lines of code. the extra row
gets inserted after the "SetTaskField Field" command. Once i go back to
"AllActive" there is now a new black row (a task). Anybody know how to get
around this, besides filtering out all the blank tasks?

'Backfeeds unassigned tasks
FilterApply Name:="Yes"
SelectAll
SetTaskField Field:="Constraint Type", Value:="As Late As Possible",
AllSelectedTasks:=True
FilterApply Name:="All Active"

thanks!
scott
Reply With Quote
  #2 (permalink)  
Old 07-17-2008, 05:47 PM
Jack Dahlgren
 
Posts: n/a
Re: way to test if task exists?

Scott,

You are going about this the wrong way.
What does your filter test for?
Let me give you an example.
Assume that the filter tests for tasks which have no resources assigned.

the code would be

sub theintern()
dim t as task
dim ts as tasks
set ts = activeproject.tasks
for each t in ts
if not t is nothing then
if not t.summary then
if t.resources = "" then
t.contstrainttype = pjALAP
end if
end if
end if
next t
end sub

Working with selections and fields the way you are doing is not very
effective. You can see the problems you have run into.
The above code works in the background no matter which view or filter is
applied.

I suggest you read through the articles on working with tasks that I have
here:
http://zo-d.com/blog/archives/programming.html

-Jack Dahlgren

"theintern" <theintern@discussions.microsoft.com> wrote in message
news:A892CB39-6865-49EC-9646-80BA95333A67@microsoft.com...
> I'm looking for a way to see if any tasks remain once a filter is applied.
> if there are tasks, i need to edit their constraints. if not, just keep
> going through the code (ideally it would create a picture saying "no tasks
> for this resource" but i realize that's probably not realistic.) The
> annoyance lies in that if there are no tasks and it tries to edit them, it
> ends up inserting an extra row. here are the lines of code. the extra
> row
> gets inserted after the "SetTaskField Field" command. Once i go back to
> "AllActive" there is now a new black row (a task). Anybody know how to
> get
> around this, besides filtering out all the blank tasks?
>
> 'Backfeeds unassigned tasks
> FilterApply Name:="Yes"
> SelectAll
> SetTaskField Field:="Constraint Type", Value:="As Late As Possible",
> AllSelectedTasks:=True
> FilterApply Name:="All Active"
>
> thanks!
> scott



Reply With Quote
  #3 (permalink)  
Old 07-17-2008, 06:06 PM
=?Utf-8?B?dGhlaW50ZXJu?=
 
Posts: n/a
Re: way to test if task exists?

The filter is for all tasks with a "Yes" in the resource initials column,
meaning that no resource has yet been assigned to them. i need to filter for
these tasks, then change their constraint types to "As Late As Possible."
But if there are no tasks with "Yes" in the resource initials, it ends up
inserting a blank task. I'll read that link you sent and see if that helps
at all. If what I've said here changes/clarifies anything, let me know.

Thanks
scott

"Jack Dahlgren" wrote:

> Scott,
>
> You are going about this the wrong way.
> What does your filter test for?
> Let me give you an example.
> Assume that the filter tests for tasks which have no resources assigned.
>
> the code would be
>
> sub theintern()
> dim t as task
> dim ts as tasks
> set ts = activeproject.tasks
> for each t in ts
> if not t is nothing then
> if not t.summary then
> if t.resources = "" then
> t.contstrainttype = pjALAP
> end if
> end if
> end if
> next t
> end sub
>
> Working with selections and fields the way you are doing is not very
> effective. You can see the problems you have run into.
> The above code works in the background no matter which view or filter is
> applied.
>
> I suggest you read through the articles on working with tasks that I have
> here:
> http://zo-d.com/blog/archives/programming.html
>
> -Jack Dahlgren
>
> "theintern" <theintern@discussions.microsoft.com> wrote in message
> news:A892CB39-6865-49EC-9646-80BA95333A67@microsoft.com...
> > I'm looking for a way to see if any tasks remain once a filter is applied.
> > if there are tasks, i need to edit their constraints. if not, just keep
> > going through the code (ideally it would create a picture saying "no tasks
> > for this resource" but i realize that's probably not realistic.) The
> > annoyance lies in that if there are no tasks and it tries to edit them, it
> > ends up inserting an extra row. here are the lines of code. the extra
> > row
> > gets inserted after the "SetTaskField Field" command. Once i go back to
> > "AllActive" there is now a new black row (a task). Anybody know how to
> > get
> > around this, besides filtering out all the blank tasks?
> >
> > 'Backfeeds unassigned tasks
> > FilterApply Name:="Yes"
> > SelectAll
> > SetTaskField Field:="Constraint Type", Value:="As Late As Possible",
> > AllSelectedTasks:=True
> > FilterApply Name:="All Active"
> >
> > thanks!
> > scott

>
>
>

Reply With Quote
  #4 (permalink)  
Old 07-17-2008, 06:30 PM
Jan De Messemaeker
 
Posts: n/a
Re: way to test if task exists?

Hi,
After Selectall :
If not activeselection=0 then
HTH
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
"theintern" <theintern@discussions.microsoft.com> wrote in message
news:23417DEF-30E6-46F8-9146-0CDFE0797768@microsoft.com...
> The filter is for all tasks with a "Yes" in the resource initials column,
> meaning that no resource has yet been assigned to them. i need to filter
> for
> these tasks, then change their constraint types to "As Late As Possible."
> But if there are no tasks with "Yes" in the resource initials, it ends up
> inserting a blank task. I'll read that link you sent and see if that
> helps
> at all. If what I've said here changes/clarifies anything, let me know.
>
> Thanks
> scott
>
> "Jack Dahlgren" wrote:
>
>> Scott,
>>
>> You are going about this the wrong way.
>> What does your filter test for?
>> Let me give you an example.
>> Assume that the filter tests for tasks which have no resources assigned.
>>
>> the code would be
>>
>> sub theintern()
>> dim t as task
>> dim ts as tasks
>> set ts = activeproject.tasks
>> for each t in ts
>> if not t is nothing then
>> if not t.summary then
>> if t.resources = "" then
>> t.contstrainttype = pjALAP
>> end if
>> end if
>> end if
>> next t
>> end sub
>>
>> Working with selections and fields the way you are doing is not very
>> effective. You can see the problems you have run into.
>> The above code works in the background no matter which view or filter is
>> applied.
>>
>> I suggest you read through the articles on working with tasks that I have
>> here:
>> http://zo-d.com/blog/archives/programming.html
>>
>> -Jack Dahlgren
>>
>> "theintern" <theintern@discussions.microsoft.com> wrote in message
>> news:A892CB39-6865-49EC-9646-80BA95333A67@microsoft.com...
>> > I'm looking for a way to see if any tasks remain once a filter is
>> > applied.
>> > if there are tasks, i need to edit their constraints. if not, just
>> > keep
>> > going through the code (ideally it would create a picture saying "no
>> > tasks
>> > for this resource" but i realize that's probably not realistic.) The
>> > annoyance lies in that if there are no tasks and it tries to edit them,
>> > it
>> > ends up inserting an extra row. here are the lines of code. the extra
>> > row
>> > gets inserted after the "SetTaskField Field" command. Once i go back
>> > to
>> > "AllActive" there is now a new black row (a task). Anybody know how to
>> > get
>> > around this, besides filtering out all the blank tasks?
>> >
>> > 'Backfeeds unassigned tasks
>> > FilterApply Name:="Yes"
>> > SelectAll
>> > SetTaskField Field:="Constraint Type", Value:="As Late As Possible",
>> > AllSelectedTasks:=True
>> > FilterApply Name:="All Active"
>> >
>> > thanks!
>> > scott

>>
>>
>>



Reply With Quote
  #5 (permalink)  
Old 07-17-2008, 06:57 PM
=?Utf-8?B?dGhlaW50ZXJu?=
 
Posts: n/a
Re: way to test if task exists?

Beautiful. Thanks so much!

"Jan De Messemaeker" wrote:

> Hi,
> After Selectall :
> If not activeselection=0 then
> HTH
> --
> Jan De Messemaeker
> Microsoft Project Most Valuable Professional
> +32 495 300 620
> For availability check:
> http://users.online.be/prom-ade/Calendar.pdf
> "theintern" <theintern@discussions.microsoft.com> wrote in message
> news:23417DEF-30E6-46F8-9146-0CDFE0797768@microsoft.com...
> > The filter is for all tasks with a "Yes" in the resource initials column,
> > meaning that no resource has yet been assigned to them. i need to filter
> > for
> > these tasks, then change their constraint types to "As Late As Possible."
> > But if there are no tasks with "Yes" in the resource initials, it ends up
> > inserting a blank task. I'll read that link you sent and see if that
> > helps
> > at all. If what I've said here changes/clarifies anything, let me know.
> >
> > Thanks
> > scott
> >
> > "Jack Dahlgren" wrote:
> >
> >> Scott,
> >>
> >> You are going about this the wrong way.
> >> What does your filter test for?
> >> Let me give you an example.
> >> Assume that the filter tests for tasks which have no resources assigned.
> >>
> >> the code would be
> >>
> >> sub theintern()
> >> dim t as task
> >> dim ts as tasks
> >> set ts = activeproject.tasks
> >> for each t in ts
> >> if not t is nothing then
> >> if not t.summary then
> >> if t.resources = "" then
> >> t.contstrainttype = pjALAP
> >> end if
> >> end if
> >> end if
> >> next t
> >> end sub
> >>
> >> Working with selections and fields the way you are doing is not very
> >> effective. You can see the problems you have run into.
> >> The above code works in the background no matter which view or filter is
> >> applied.
> >>
> >> I suggest you read through the articles on working with tasks that I have
> >> here:
> >> http://zo-d.com/blog/archives/programming.html
> >>
> >> -Jack Dahlgren
> >>
> >> "theintern" <theintern@discussions.microsoft.com> wrote in message
> >> news:A892CB39-6865-49EC-9646-80BA95333A67@microsoft.com...
> >> > I'm looking for a way to see if any tasks remain once a filter is
> >> > applied.
> >> > if there are tasks, i need to edit their constraints. if not, just
> >> > keep
> >> > going through the code (ideally it would create a picture saying "no
> >> > tasks
> >> > for this resource" but i realize that's probably not realistic.) The
> >> > annoyance lies in that if there are no tasks and it tries to edit them,
> >> > it
> >> > ends up inserting an extra row. here are the lines of code. the extra
> >> > row
> >> > gets inserted after the "SetTaskField Field" command. Once i go back
> >> > to
> >> > "AllActive" there is now a new black row (a task). Anybody know how to
> >> > get
> >> > around this, besides filtering out all the blank tasks?
> >> >
> >> > 'Backfeeds unassigned tasks
> >> > FilterApply Name:="Yes"
> >> > SelectAll
> >> > SetTaskField Field:="Constraint Type", Value:="As Late As Possible",
> >> > AllSelectedTasks:=True
> >> > FilterApply Name:="All Active"
> >> >
> >> > thanks!
> >> > scott
> >>
> >>
> >>

>
>
>

Reply With Quote
  #6 (permalink)  
Old 07-18-2008, 09:46 PM
Mike Glen
 
Posts: n/a
Re: way to test if task exists?

Hi ,

Next time, try posting on the microsoft.public.project.developer newsgroup.
Please see FAQ Item: 24. Project Newsgroups. FAQs, companion products and
other useful Project information can be seen at this web address:
http://project.mvps.org/faqs.htm

Mike Glen
Project MVP


theintern wrote:
> Beautiful. Thanks so much!
>
> "Jan De Messemaeker" wrote:
>
>> Hi,
>> After Selectall :
>> If not activeselection=0 then
>> HTH
>> --
>> Jan De Messemaeker
>> Microsoft Project Most Valuable Professional
>> +32 495 300 620
>> For availability check:
>> http://users.online.be/prom-ade/Calendar.pdf
>> "theintern" <theintern@discussions.microsoft.com> wrote in message
>> news:23417DEF-30E6-46F8-9146-0CDFE0797768@microsoft.com...
>>> The filter is for all tasks with a "Yes" in the resource initials
>>> column, meaning that no resource has yet been assigned to them. i
>>> need to filter for
>>> these tasks, then change their constraint types to "As Late As
>>> Possible." But if there are no tasks with "Yes" in the resource
>>> initials, it ends up inserting a blank task. I'll read that link
>>> you sent and see if that helps
>>> at all. If what I've said here changes/clarifies anything, let me
>>> know.
>>>
>>> Thanks
>>> scott
>>>
>>> "Jack Dahlgren" wrote:
>>>
>>>> Scott,
>>>>
>>>> You are going about this the wrong way.
>>>> What does your filter test for?
>>>> Let me give you an example.
>>>> Assume that the filter tests for tasks which have no resources
>>>> assigned.
>>>>
>>>> the code would be
>>>>
>>>> sub theintern()
>>>> dim t as task
>>>> dim ts as tasks
>>>> set ts = activeproject.tasks
>>>> for each t in ts
>>>> if not t is nothing then
>>>> if not t.summary then
>>>> if t.resources = "" then
>>>> t.contstrainttype = pjALAP
>>>> end if
>>>> end if
>>>> end if
>>>> next t
>>>> end sub
>>>>
>>>> Working with selections and fields the way you are doing is not
>>>> very effective. You can see the problems you have run into.
>>>> The above code works in the background no matter which view or
>>>> filter is applied.
>>>>
>>>> I suggest you read through the articles on working with tasks that
>>>> I have here:
>>>> http://zo-d.com/blog/archives/programming.html
>>>>
>>>> -Jack Dahlgren
>>>>
>>>> "theintern" <theintern@discussions.microsoft.com> wrote in message
>>>> news:A892CB39-6865-49EC-9646-80BA95333A67@microsoft.com...
>>>>> I'm looking for a way to see if any tasks remain once a filter is
>>>>> applied.
>>>>> if there are tasks, i need to edit their constraints. if not,
>>>>> just keep
>>>>> going through the code (ideally it would create a picture saying
>>>>> "no tasks
>>>>> for this resource" but i realize that's probably not realistic.)
>>>>> The annoyance lies in that if there are no tasks and it tries to
>>>>> edit them, it
>>>>> ends up inserting an extra row. here are the lines of code. the
>>>>> extra row
>>>>> gets inserted after the "SetTaskField Field" command. Once i go
>>>>> back to
>>>>> "AllActive" there is now a new black row (a task). Anybody know
>>>>> how to get
>>>>> around this, besides filtering out all the blank tasks?
>>>>>
>>>>> 'Backfeeds unassigned tasks
>>>>> FilterApply Name:="Yes"
>>>>> SelectAll
>>>>> SetTaskField Field:="Constraint Type", Value:="As Late As
>>>>> Possible", AllSelectedTasks:=True
>>>>> FilterApply Name:="All Active"
>>>>>
>>>>> thanks!
>>>>> scott



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Project


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 07:45 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Loans | Mortgage Calculator | Debt Help | Remortgages | Mobile Phones



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109