问题描述
RT
解决方案
解决方案二:
研究一下这些吧,都是NotesDesigner中的帮助。1.ThisagentextractsthefileattachmentsintheBodyitemofthecurrentdocumentusingNotesRichTextNavigatormethodstogettheattachments.REMRunthisagainstaselecteddocumentthathasBodyfieldREMBodyfieldshouldcontainfileattachmentsSubInitializeDimsessionAsNotesSessionDimdbAsNotesDatabaseDimdcAsNotesDocumentCollectionDimdocAsNotesDocumentDimbodyAsNotesRichTextItemDimrtnavAsNotesRichTextNavigatorDimattAsNotesEmbeddedObjectSetsession=NewNotesSessionSetdb=session.CurrentDatabaseSetdc=db.UnprocessedDocumentsSetdoc=dc.GetFirstDocumentIfNotdoc.HasEmbeddedThenExitSubSetbody=doc.GetFirstItem("Body")Setrtnav=body.CreateNavigatorREMGetattachmentsIfrtnav.FindFirstElement(RTELEM_TYPE_FILEATTACHMENT)ThenDoSetatt=rtnav.GetElement()filepath$="C:Files"&att.SourceCallatt.ExtractFile(filepath$)Printfilepath$&"extracted"LoopWhilertnav.FindNextElement()EndIfEndSub2.ThisagentextractsthefileattachmentsintheBodyitemofthecurrentdocumentusingNotesRichTextItem.EmbeddedObjectspropertytogettheattachments.REMRunthisagainstaselecteddocumentthathasBodyfieldREMBodyfieldshouldcontainfileattachmentsSubInitializeDimsessionAsNotesSessionDimdbAsNotesDatabaseDimdcAsNotesDocumentCollectionDimdocAsNotesDocumentDimbodyAsNotesRichTextItemSetsession=NewNotesSessionSetdb=session.CurrentDatabaseSetdc=db.UnprocessedDocumentsSetdoc=dc.GetFirstDocumentIfNotdoc.HasEmbeddedThenExitSubSetbody=doc.GetFirstItem("Body")REMGetattachmentsForallattInbody.EmbeddedObjectsIfatt.Type=EMBED_ATTACHMENTThenfilepath$="C:Files"&att.SourceCallatt.ExtractFile(filepath$)Printfilepath$&"extracted"EndIfEndForallEndSub3.Thisformactionexampledisplayspropertiesofalltheembeddedobjectsinadocument.SubClick(SourceAsButton)DimworkspaceAsNewNotesUIWorkspaceDimuidocAsNotesUIDocumentDimdocAsNotesDocumentDimitemAsVariantSetuidoc=workspace.CurrentDocumentSetdoc=uidoc.DocumentSetitem=doc.GetFirstItem("Body")ForallembobjInitem.EmbeddedObjectsverbs="Noverbs"SelectCaseembobj.TypeCaseEMBED_OBJECTLINK:_embobjType="Objectlink"CaseEMBED_ATTACHMENT:_embobjType="Attachment"CaseEMBED_OBJECT:embobjType="Object"verbs="Verbs:"ForallverbInembobj.Verbsverbs=verbs&""&verbEndForallEndSelectMessagebox"Name:"&embobj.Name&Chr(10)_&"Class:"&embobj.Class&Chr(10)_&"Filesize:"&embobj.FileSize&Chr(10)_&"Type:"&embobjType&Chr(10)&verbsEndForallEndSub4.Thisformactionexampleactivatesthefirstoronlyembeddedobjectinadocument.SubClick(SourceAsButton)DimworkspaceAsNewNotesUIWorkspaceDimuidocAsNotesUIDocumentDimdocAsNotesDocumentDimitemAsVariantSetuidoc=workspace.CurrentDocumentSetdoc=uidoc.DocumentSetitem=doc.GetFirstItem("Body")IfIsempty(item.EmbeddedObjects)ThenMessagebox"Noembeddedobjectindocument"ExitSubEndIfIfitem.EmbeddedObjects(0).Type<>EMBED_OBJECTThenMessagebox"Objectnotanembeddedobject"ExitSubEndIfCallitem.EmbeddedObjects(0).Activate(True)EndSub
解决方案三:
做个视图,在视图中写个操作.