T
thoff
I'm trying to access the build-in document properties in VB in Visual Studio
2008 with the following code:
Dim proj As Microsoft.Office.Interop.MSProject.Project
Dim f As New AddFunction
Dim properties As Microsoft.Office.Core.DocumentProperties
Dim prop As Microsoft.Office.Core.DocumentProperty
proj = Globals.ThisAddIn.Application.ActiveProject
f.ShowDialog()
properties = DirectCast(proj.BuiltinDocumentProperties, _
Microsoft.Office.Core.DocumentProperties)
prop = properties.Item("Source")
MsgBox(" Source = " & prop.Value)
proj = Nothing
When I run this I get the following error message.
A first chance exception of type 'System.ArgumentException' occurred in
ProjectAddIn2.DLL
Can anyone give me some advice? Thanks.
2008 with the following code:
Dim proj As Microsoft.Office.Interop.MSProject.Project
Dim f As New AddFunction
Dim properties As Microsoft.Office.Core.DocumentProperties
Dim prop As Microsoft.Office.Core.DocumentProperty
proj = Globals.ThisAddIn.Application.ActiveProject
f.ShowDialog()
properties = DirectCast(proj.BuiltinDocumentProperties, _
Microsoft.Office.Core.DocumentProperties)
prop = properties.Item("Source")
MsgBox(" Source = " & prop.Value)
proj = Nothing
When I run this I get the following error message.
A first chance exception of type 'System.ArgumentException' occurred in
ProjectAddIn2.DLL
Can anyone give me some advice? Thanks.