1\定位文档有很多种方法,最简单的一个方法就是得到一个文档的unid,然后获得文档对象,也可以先取得一个文档集合,再处理。下面用一个docunid得到一个文档:
dim s as new notesSession
dim db as notesdb
dim doc notesDocument
set db=s.currentdatabase
set doc=db.getdocumentbyunid(docunid)
2,dim uiwks as new notesuiworkspace
dim uidoc as notesuidocument
dim doc as notesdocument
dim txtvalue$
set uidoc=uiwks.currentdocument
set doc=uidoc.document
txtvalue=doc.txtfield(0)
3,notesdatetime.dateonly notedatetime.timeonly
4,
set embededobjects=notesrtfitem.embeddedobjects
forall a in embededobjects
extract a "c:"
end forall
5,embedobjects to a rtfitem:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", "c:\jim.sam")
doc.Form = "Main Topic"
doc.Subject = "Here's Jim's document, as an attachment"
Call doc.Save( True, True )