Friday, April 17, 2020

MS Project Automation

Add reference to:
  • Microsoft Office Project 16 Object Library.
Imports Microsoft.Office.Interop

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim pjApp As New MSProject.Application
        pjApp = New MSProject.Application
        pjApp.Visible = True
        pjApp.FileNew()
        pjApp.ActiveProject.Tasks.Add("Wind clocks")
        pjApp.FileSave()
        pjApp.FileClose()
        MsgBox("about to close project")
        pjApp.Quit()
    End Sub

End Class

No comments:

Post a Comment

Checkmark in Office Products

 Font: Wingding, ALT 0525: &#x2713 Note that the Unicode for that to be able to see it in HTML is  &#x2713 Note that the Blogger...