This is really odd, I can’t figure it out. Here’s my simple code…
Dim PartSpecNID as Variant
PartSpecNID = doc.Getitemvalue(“PartSpecNID”)
Set psDoc = db.Getdocumentbyid(PartSpecNID(0))
If psDoc Is Nothing Then MessageBox “Document Not Found” Exit Sub End If
PartSpecNID(0) has a value of “A66”… I have tried directly entering the NoteID string of “00000A66” and “A66”…the document exists and I confirmed this is the correct NoteId…
I even have a doc link to it that works…
Why am I getting Document Not Found???
Please help
thanks, Tina
Subject: It still fails if I bypass the variable PartSpecNID
I tested with the following, bypassing the PartSpecNID variable, and it still fails. It’s Very bizarre!!
Set psDoc = db.Getdocumentbyid( “00000A66” ) -
Subject: Found issue
OK- I think I found the issue… there is something iffy with the document…there might be 2 of them instead of just 1. Never mind, thanks Barry for the help…
Subject: Question/answer
Are you using the PartSpecNID as a notesUNID to a document in the db? Not a good way of coding since unid can change if you cut/paste or run fixup on the db. best might to create a view based on PartSpecNID and use GetDocumentByKey
That aside to use Getdocumentbyid the key needs to be match exactly so in your case “00000A66”