Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Cincinnati, Ohio
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use Accessfield contents to create task in Project (2003)

    I use the following to create/update an MS Project plan with a list of tasks (found on MS KBID 210014)

    Function fncProjectOLE()
    Dim prjApp As MSProject.Application
    Dim prjProject As MSProject.Project
    Dim intTask As Integer

    Set prjApp = CreateObject("Msproject.Application")

    prjApp.FileOpen "C:Project1.mpp", ReadOnly:=True
    prjApp.Visible = True

    'Run a macro.
    prjApp.Macro "Toggle_Read_Only" 'Toggle file back to read-write.

    Set prjProject = prjApp.ActiveProject

    'Add tasks to the project.
    prjProject.Tasks.Add Name:="Build Team"
    prjProject.Tasks.Add Name:="Project Kickoff"
    prjProject.Tasks.Add Name:="Gather Requirements"
    ' et al.

    prjApp.SelectColumn
    prjApp.FontItalic True 'Change font properties.
    prjApp.EditGoTo 5, Date 'Go to a specific cell in the column.
    prjApp.FilePrintPreview 'Print preview the file.

    Set prjProject = Nothing
    Set prjApp = Nothing
    End Function

    This is called from form frmProjects. I would like to create a task using the contents of a field within that form (ProjectName).
    I am trying :
    prjProject.Tasks.Add Name:= " " & forms!frmProjects!ProjectName but cannot get the syntax right.
    Any help would be appreciated. Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Use Accessfield contents to create task in Project (2003)

    I don't understand what the space before the task name is for, but this seems to be primarily an MS Project question - apart from the reference to a control on a form, all the code is specific to MS Project.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Use Accessfield contents to create task in Project (2003)

    The question has been reposted in the Project forum. This thread is locked to prevent duplication and confusion. Anyone wanting to reply, please do so in the thread starting at <post:=620,693>post 620,693</post:>.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •