Took a LONG time, but here's what I came up with (the "documents" object model can be easily confused with how custom database properties are set). There's plenty to be found for custom db properties, but not so much for document properties.



Code:
Sub setProp()
Dim db As Database
Dim prop As Property
Dim doc As DAO.Document
Dim strProp As String, strName As String

On Error GoTo errHandler
Set db = CurrentDb
Set doc = db.Containers("Databases").Documents("UserDefined")

strProp = "Project"
strName = "Test2"

doc.Properties(strProp).Value = strName

exitHere:
Set db = Nothing
Set prop = Nothing
Set doc = Nothing
Exit Sub

errHandler:
Select Case Err.Number
  Case 3270 'property does not exist
      Set prop = db.CreateProperty(strProp, dbText, strName, True)
      doc.Properties.Append prop
  Case 3367 'property already exists
     'create your own message or routine here, or maybe just Resume or Resume Next to ignore (depends on what you do with this)
  Case Else
      MsgBox "Error " & Err.Number & ": " & Err.Description
End Select
Resume Next 'watch this - if you add code after the point that generated the error, you'll go back to that point

End Sub
Note: to work this into your project, you'll have to decide how to make use of it (assuming you will). You might want to make this a function that accepts input so that any custom documents property can be created. Don't confuse this with custom database properties (such as AllowBypassKey). What you're working with is the documents container properties. While it looks like a lot of code for what you wanted, most of it is error handling, cleanup and navigation if a property doesn't exist. It really boils down to
"doc.Properties(strProp).Value = strName"
or a longer version of that if the variables are not dim'd. Kind of like what I first posted way back.