VB Macro in Mircrosoft Project
Last answer on Feb 9, 2009 8:58:49 am GMT Schedule_VBN00b, on Feb 9, 2009 6:03:28 am GMTHello,
I'm trying to create a Customized Interim Baseline Save Macro.
I was able to get a macro that saves baseline details only to a start and finish field:
BaselineSave All:=True, Copy:=0, Into:=1
Now the next task I would like it to do is to copy the percent complete field into a text field.
I'm a complete newbie to Visual Basic and I'm trying to automate a lot of my Microsoft project tasks.
I dug up some documentation online and came up with this:
Dim t as task
Dim ts as tasks
Set Ts = ActiveProject.Tasks
intTcounter = 0
If not t is nothing then
t.PercentageComplete = t.Text7
intTcounter = intTcounter + 1
End If
next t
'Display message
MsgBox ("Macro done" & Chr(13) & intTcounter & " Task Complete")
This returns the number of tasks in my project file but does not copy the percentage complete value in the text field. I think I need to convert the Percentage complete to text somewhow so that text 7 can save a "0%" value. I'm pretty sure this is easy for VB programmers out there!!!
Ahhh please help!! I'm sure you guys know this is a simple issue - if you know how!!!
Also - I need to find a way to show up a message box on closing the file that it compares the current dates to the baseline fields and if there is a discrepancy or change, a notice saying "current dates not longer align with baseline - are you sure you want to save?"....
Any assistance will be greatly appreciated.
Regards
Configuration: Windows XP Internet Explorer 6.0

