few VBA questions

J

Joy

Hi, I have few questions about writing macros


1. how to check that a task is a summary task? I mean, which field can
provide such infor?

2. the ms project is imorted from CSV file.
how to locate the end of a MS project file? I want to create a summary task
at the end of the file, that is, the next row of the last task in the
project. how to create the summary row?

Thank you very much.

I may have more later, sorry, I am fresh new to VBA...
 
J

John

Joy said:
Hi, I have few questions about writing macros


1. how to check that a task is a summary task? I mean, which field can
provide such infor?

2. the ms project is imorted from CSV file.
how to locate the end of a MS project file? I want to create a summary task
at the end of the file, that is, the next row of the last task in the
project. how to create the summary row?

Thank you very much.

I may have more later, sorry, I am fresh new to VBA...

Joy,
Project has a Summary field that can be queried (boolean) to determine
if a task is a summary.

Your second question doesn't quite make sense. If you put a summary row
at the end of the file, what is it a summary for? A summary row is
always at the beginning of a group of tasks. If you simply mean that you
want to import the csv file and then have a summary for the whole
project, simply use the DisplayProjectSummaryTask Property on the
ActiveProject object.

You indicate you are new to VBA. I highly recommend fellow MVP, Rod
Gill's book on Project VBA. You can find out more about it at,
http://www.projectvbabook.com.

Hope this helps.
John
Project MVP
 
J

Joy

John,

Thank you for your reply.

sorry, I may not put it clearly.
we import project from CSV file

then, after that, if user wants to delete a task, a new summary task will be
created at the end of the file,. The summary task is used to collected tasks
deleted. then, if user deletes a task, the task to be deleted will be put in
to the summary task.

I am confused about how to do this...

many thanks
 
J

Joy

sorry, for the 1 st one, I still cannot figure out how to do it

like I have a task ( tsk ), how I can check that if it is a summary


btw, we ordered the book upon your recommendation

thanks
 
J

Jan De Messemaeker

Hi,

If tsk.summary then

At the and of the list add a normal task and use .outdent to put it on the
right outlinelevel
Then add teh "deleted" task and use .indent

Find help on these and other methods in the Object browser (a button in the
VB Editor)
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
J

Joy

thank you

Jan De Messemaeker said:
Hi,

If tsk.summary then

At the and of the list add a normal task and use .outdent to put it on the
right outlinelevel
Then add teh "deleted" task and use .indent

Find help on these and other methods in the Object browser (a button in the
VB Editor)
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

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