lotus编程学习笔记.docx

上传人:b****2 文档编号:909475 上传时间:2022-10-13 格式:DOCX 页数:34 大小:47.32KB
下载 相关 举报
lotus编程学习笔记.docx_第1页
第1页 / 共34页
lotus编程学习笔记.docx_第2页
第2页 / 共34页
lotus编程学习笔记.docx_第3页
第3页 / 共34页
lotus编程学习笔记.docx_第4页
第4页 / 共34页
lotus编程学习笔记.docx_第5页
第5页 / 共34页
点击查看更多>>
下载资源
资源描述

lotus编程学习笔记.docx

《lotus编程学习笔记.docx》由会员分享,可在线阅读,更多相关《lotus编程学习笔记.docx(34页珍藏版)》请在冰豆网上搜索。

lotus编程学习笔记.docx

lotus编程学习笔记

lotus编程学习笔记用NotesDatabase.search方法来统计符合条件的文档个数

SubClick(SourceAsButton)

DimsessionAsNewNotesSession

DimdbAsNotesDatabase

DimcollectionAsNotesDocumentCollection'要搜索的文档的起始时间

DimdateTimeAsNewNotesDateTime("01/01/96")Setdb=session.CurrentDatabase

'Search的第一个参数是用公式语言表达的搜索条件

Setcollection=db.Search("Form='qj'",dateTime,0)

Messageboxcollection.Count

EndSub

提示邮箱信息的代码

DimsAsNewNotesSession

DimdbAsNotesDatabase

DimunameAsString

DimmailfilelocAsVariant

ConstMB_OK=1

ConstMB_ICONINFORMATION=64boxtype&=MB_OK+MB_ICONINFORMATION

Setdb=s.CurrentDatabaseuname=s.CommonUserName

srvname=Evaluate("@Name([CN];@Subset(@MailDBName;1))")mailfileloc=Evaluate("@Subset(@MailDBName;-1)")

DimmydbAsNewNotesDatabase(Cstr(srvname(0)),Cstr(mailfileloc(0)))

Msgbox"Server:

"&srvname(0)&Chr$(13)_

&"Dbdirectoryanddbname:

"&mailfileloc(0)&Chr$(13)&Chr$(13)_

&"Thesizeofyourmailfileis:

"_

&Round(mydb.Size/1048576,2)&"Mb",boxtype&,"Mailfileof"&uname&"..."

建立/获取/修改简要表文档示例4-2展示了怎样建立、获取、和修改简要表文档的示例。

如果没有找到这个描述文档docProfile那么就会建立它,然后,它就会检查这个文档中的值Company字段。

如果没有设置这个字段,那么就会对其进行更新,并且保存新值。

如果已经进行了设置那么就不会再进行更多的处理。

示例4-2建立/获取/修改简要表文档

SubInitialize

DimsessionAsNewNotesSession

DimdbAsNotesDatabase

DimdocProfileAsNotesDocument

DimsAuthorAsString

DimitemCompanyAsNotesItem

Setdb=session.CurrentDatabase

SetdocProfile=db.GetProfileDocument("Profiles",session.UserName)

SetitemCompany=docProfile.GetFirstItem("Company")

IfitemCompanyIsNothingThendocProfile.Company="ConCrea"CalldocProfile.save(True,False)

EndIf

EndSub

用公式打开“关于数据库”、“使用数据库”文档@Command([HelpAboutDatabase])

@Command([HelpUsingDatabase])

让组合框下拉时有一个空值可以选@Explode(@Char(255):

"男":

"女")

用Messagebox判断用户做出的选择

SubClick(SourceAsButton)answer%=Messagebox("Doyouwanttocontinue?

",36,"Continue?

")Ifanswer%=6Then

Messagebox"YouclikedOK!

"Else

Messagebox"YouclikedNO!

"EndIf

EndSub

@IsDocBeingEdited

1(True);否则返回0(False)。

检查文档的当前状态,如果文档正在被编辑,则返回语法

@IsDocBeingEdited

返回值flag

布尔型

1(True)表示正在编辑该文档

0(False)表示不在编辑该文档用法该函数不能用于列公式、选择公式、代理、表单公式或视图操作公式中。

常用于按钮公式、隐藏公式、域公式和表单操作公式中。

例:

tmp:

=@if(@IsDocBeingEdited;"在编辑状态";"不在编辑状态");@prompt([OK];"提示是否在编辑状态";tmp)相关主题@IsDocBeingLoaded

@IsDocBeingMailed@IsDocBeingRecalculated@IsDocBeingSaved

用NotesDocument后台类改变UI文档的域值

SubClick(SourceAsButton)'改变当前文档中的Main_Status域值

DimworkspaceAsNewNotesUIWorkspaceDimuidocAsNotesUIDocument

DimdocAsNotesDocument

Setuidoc=workspace.CurrentDocument

Setdoc=uidoc.Documentdoc.Main_Status="5"Calldoc.Save(True,True)

EndSub

将当前文档置于编辑模式中@Command([EditDocument];"1")使用LotusScript获得群组中的用户列表

Declarations

DimcountAsInteger

DimpersonsListAsString

DimgroupsList

DimtgAsInteger

DimxyAsInteger

SubInitialize

'Theadvantateofthiscodeisthatwecanprocessanynestedgroupswithoutanysizelimitaions.DimsessionAsNewnotessession

DimwsAsNewnotesuiworkspace

DimuidocAsNotesUIDocument

DimdbAsnotesdatabase

DimnamesdbAsnotesdatabase

DimgroupdocAsnotesdocument

DimgroupviewAsnotesview

DiminsidegroupdocAsnotesdocument

DiminsidegroupsAsnotesview

DimdocAsnotesdocument

DimcurviewAsnotesview

DimnewlistList

Setdb=session.CurrentDatabase

Setnamesdb=session.GetDatabase(db.Server,"names.nsf")

Setgroupview=namesdb.GetView("($Users)")

Setinsidegroups=namesdb.getview("($VIMGroups)")

Setcurview=db.getview("second")

Setuidoc=ws.CurrentDocument

Setdoc=curview.getfirstdocument'youcansetyourowndochere.Thisthebackenddocumentforthecurrentlyopeneduidoc.Youcanfindotheralternativestorunthisagent.groupName$=uidoc.FieldGetText("names")'Hereweareenteringthegrouporpersonnames.

DimritemAsVariant

Setritem=doc.GetFirstItem("all")'Herewearegoingtostorethegroupextractedpeople'sname

'Calluidoc.FieldSetText("saveoptions","1")

Calluidoc.FieldSetText("Total","")'Herewewilllistthetotalparticipantlist.

Calluidoc.FieldSetText("all","")'makingthefieldnulltoprintanewvalue.Calluidoc.Save

Calluidoc.reload

Calluidoc.save

ForallentryIndoc.namesgtype=group(entry)'CheckingwhethertheentryisagrouporPeople.Ifgtype="Group"Then

tg=tg+1groups(tg)=entry

Else

Calladdtolist(entry)'Ifentryisaperson,thenaddingtoalistcalledPeople.EndIf

EndForall

'nowwehavegottwolistsoneispersonandanotheroneisgroup

'Thisloopwillreturnsyoualistinthepeople'sview.andremovetheeachgroupentryafterprocessing.

xy=0

DoUntilxy=tg

xy=xy+1et=groupget(groupview,groups(xy))

Erasegroups(xy)

Loop

If(ritem.Type<>RICHTEXT)Then

ExitSub

EndIf'Iamaddingthelisttoanotherarray,becauseiamnotgettingthelistwithuniquevalues.Youcantrysomeothercodeifyoucanretrunsthelist

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 设计艺术

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1