Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
EmbeddedObjectsChecker

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#EmbeddedObjects or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/EmbeddedObjects


EmbeddedObjects property can give a variant or type mismatch error when you try and cycle through them. Here is how to avoid errors.





 

Tips: Always grab the richtextitem as a variant. The Isarray is the trick to avoid embeddedobjects errors.

Dim Addinfo As variant
Set Addinfo = doc.getfirstitem("rAdditionalInfo")

If Addinfo Is Nothing Then
Print "Cannot find rich text item rAdditonalInfo."
 End
End If

If Isarray ( Addinfo.EmbeddedObjects) Then
   Forall o In Addinfo.EmbeddedObjects
    If Not (o Is Nothing) Then
     If ( o.Type = EMBED_ATTACHMENT ) Then
       'blah
     End If 'attachment
    End If ' not nothing
   End Forall

End If ' there are embedded objects

 

And that's it!

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Lotus Notes 5 All-in-one Certification Exam Guide by Libby Schwarz, Ben Malekzadeh
Sort out your CLP with this book.
See at: Amazon.co.uk | Amazon.com |