lotus notes - System.__ComObject in LotusNotes in VB.net when extracting Attachments -


i want access lotus notes database , attachments documents in it. can open db , doc , loop through items. problem is, can not use items notesrichtextitem , therefore not check if there item.embeddedobject. guess problem declaration of items. in general: if debug using vs2010, doc , database , notessession have "value" system.__comobject , "type" domino.notes object should be. e.g. doc in watch:

name   value                 type      doc    {system.__comobject}  domino.notesdocument 

but if use doc.gettype() command result

doc.gettype()  = {name = "__comobject" fullname = "system.__comobject"}  

since not know if doc.item notesrichtextitem, define object , want check afterwards type. can't since return value of functions above doc, too. here complete code use currently, loaded lotus domino reference com section.

public sub opendocumentln()         try       dim ns new domino.notessession       dim db domino.notesdatabase       dim doc domino.notesdocument       dim view domino.notesview        if not (ns nothing)         ns.initialize()         db = ns.getdatabase("", slotusnotespath & slotusnotesdb, false)         if not (db nothing)           view = db.getview(slotusview)           doc = view.getfirstdocument           while not doc nothing             dim lnnextdoc domino.notesdocument = view.getnextdocument(doc)              each item domino.notesitem in doc.items               dim rtitem object = doc.getfirstitem(item.name)                if rtitem nothing continue              if not rtitem.gettype() = gettype(domino.notesrichtextitem) continue              ' never reach part of code since if clause prevents due type problem               if rtitem.embeddedobjects nothing continue               each o domino.notesembeddedobject in rtitem.embeddedobjects                 o.extractfile(slotusexportpath & o.source)               next              next             doc = lnnextdoc           end while          end if         db = nothing         ns = nothing       end if     catch ex exception      end try   end sub 

how can use rtitem notesrichtextitem can handle appropiate? , why objects treated als comobjects?


Comments