Accessing builtindocumentproperties

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.
 
M

Mike Glen

Hi thoff ,

Try posting on the developer newsgroup as this one is closing down. Please
see FAQ Item: 24. Project Newsgroups. FAQs, companion products and other
useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top