View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jan Petter Jan Petter is offline
external usenet poster
 
Posts: 6
Default Custom properties not showing the value when set programmatically

Hi,

When I create a CustomDocumentProperty programmatically and set the
LinkToContent value to True, the value is not available to use
programmatically before I have accessed the menu File-Properties.
To illustrate it I have included some sample code, just create a new
workbook and add a button to it. Paste the following code into the
"ThisWorkbook"

Private Sub Workbook_Open()
ActiveSheet.Range("A1").Value = "Test"
ActiveSheet.Names.Add Name:="TestName", RefersTo:="=Sheet1!$A$1"
ActiveWorkbook.CustomDocumentProperties.Add Name:="CustomProp",
LinkToContent:=True, Type:=msoPropertyTypeString, LinkSource:="TestName"
End Sub

Add the following code into the button event handler
MsgBox ActiveWorkbook.CustomDocumentProperties("CustomPro p").Value

Is there a way to get Excel to populate the CustomDocumentProperties
programmatically, We are integrating all our documents with Meridio which is
a EDRM solution and this program use the DocumentProperties when storing the
documents

Regards
Jan Petter