Article ID: 179466
Article Last Modified on 1/22/2007
Sub ResourceNames()
Dim A As Assignment
For Each A In ActiveCell.Task.Assignments
MsgBox A.ResourceName
Next A
End Sub
pj.Application.Open "My Project.mpp"
The corrected line is:
pj.Application.FileOpen "My Project.mpp"
The following example changes the name of the base calendar from
Night Shift to Third Shift.
Sub RenameStandardCalendar()
BaseCalendarRename FromName:="Night Shift", ToName:="Third Shift"
End Sub
The following example sets the constraint type to SNET and the constraint date to the current date for tasks in the active project without constraint types.
The following example sets the constraint type to SNET and the constraint date to the current date for tasks in the active project with the default constraint of ASAP.
The following example prompts the user for a date or a task name, and then scrolls to that date or task in the active pane. It assumes the user is in a task view.
Sub PromptUserForEditGotoArguments()
Dim Entry As String ' Date or task name entered by user.
Entry = InputBox$("Enter a date or a task name to which you want" _
& " to scroll in the active pane.")
' If user enters a date, scroll to a date in the active pane.
If IsDate(Entry) Then
EditGoTo Date:=Entry
' Otherwise, scroll to a task in the active pane.
Else
EditGoTo ID:=ActiveProject.Tasks(Entry).ID
End If
End Sub
Returns the name of the field in the active cell.
Returns the title of the field in the active cell. If a title does not exist, then the name of the field is returned.
Returns a List object representing the field names for all selected fields.
Returns a List object representing the field names (or field titles, if available) for all selected fields.
If InStr(Projects(1).Name, ".") Then
WSName = Left$(Projects(1).Name, Len(Projects(1).Name) - 1) & "W"
Else
WSName = Projects(1).Name & ".MPW"
End If
Repeats the last search and returns True if the search value is found.
Syntax
expression.FindPrevious
expression Optional. An expression that returns an Application object.
Remarks
The FindPrevious method is functionally identical to the FindNext
method. It is retained for compatibility with previous versions of
Microsoft Project.
The following example formats selected text using 16-point Tahoma.
Sub FormatTahoma16()
Font Name:="Tahoma", Size:=16, Bold:=False, Italic:=False, _
Underline:=False, Color:=pjBlack
End Sub
Optional String. A keyword for the Index tab to search on.
Optional String. A letter for the Index tab to search on.
The following example displays the topic or list of topics, if the keyword has a match. If there is no match, it displays the Contents and Index dialog box with the Index tab on top and "task" entered as the search word.
Sub SearchHelp()
HelpLaunch Search:=True, SearchKey:="task"
End Sub
It should read:
The following example displays the Contents and Index dialog box with the Index tab on top, where "t" is entered as the search word and the first index entry that starts with "t" is selected.
Sub SearchHelp()
HelpLaunch Search:=True, SearchKey:="t"
End Sub
Sub SetOverTimeRate()
Dim R As Resource ' Resource object used in For Each loop
Dim StdRate As Double ' Numeric value of resource's standard rate
Dim Count As Integer ' Counter used in For Next loop
Dim FirstNumber As Integer ' Position of the first number
For Each R In ActiveProject.Resources
' Find the first character that is a number
For Count = 1 To Len(R.StandardRate)
If IsNumeric(Mid(R.StandardRate, Count, 1)) Then
FirstNumber = Count - 1
Exit For
End If
Next Count
' Strip off any leading currency symbol and then use the
' Val function to ignore any characters that follow the number
StdRate = Val(Right$(R.StandardRate, Len(R.StandardRate) - FirstNumber))
' Set the overtime rate
R.OvertimeRate = 1.5 * StdRate
Next R
End Sub
ViewApplyName:="Check Tasks View"The corrected line is:
ViewApplyName:="Check Resources View"
ActiveProject.Resources("Tamara").CostRateTables("C"). _
PayRates.Add("12/1/96", "$25/h", "$40/h", "$0")
The corrected line is:
ActiveProject.Resources("Tamara").CostRateTables("C"). _
PayRates.Add "12/1/96", "$25/h", "$40/h", "$0"
Left$(Project.Name, 3)should read:
Left$(ActiveProject.Name, 3)
(StartSplitOn) "If a time is not specified, the project's default end
time for the working period is used."
(EndSplitOn) "If a time is not specified, the project's default start
time for the working period is used."
Dim WhichTask As String
It should read:
Dim WhichTask As Long
Additionally, the line which reads:
WhichTask = InputBox$("Which task would you like to split?")
should read:
WhichTask = InputBox("Enter the ID of the task you would like to " _
& "split:")
The following example displays the name of every task in the selection.
Sub CreateNewProject()
FileOpen ActiveProject.Template & ".mpt"
End Sub
The following example removes a successor from every task in the active project.
The following example removes the specified successor from every task in the active project.
Screen:=pjResourceSheetshould be changed to:
Screen:=pjGantt
Keywords: kbdtacode kbprogramming KB179466