lotus 编程学习笔记文档格式.docx
《lotus 编程学习笔记文档格式.docx》由会员分享,可在线阅读,更多相关《lotus 编程学习笔记文档格式.docx(43页珍藏版)》请在冰豆网上搜索。
提示邮箱信息的代码
------------------------------
DimsAsNewNotesSession
DimunameAsString
DimmailfilelocAsVariant
ConstMB_OK=1
ConstMB_ICONINFORMATION=64
boxtype&
=MB_OK+MB_ICONINFORMATION
Setdb=s.CurrentDatabase
uname=s.CommonUserName
srvname=Evaluate("
@Name([CN];
@Subset(@MailDBName;
1))"
mailfileloc=Evaluate("
-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"
IfitemCompanyIsNothingThen
docProfile.Company="
ConCrea"
CalldocProfile.save(True,False)
EndIf
用公式打开“关于数据库”、“使用数据库”文档
-----------------------------------------
@Command([HelpAboutDatabase])
@Command([HelpUsingDatabase])
让组合框下拉时有一个空值可以选
--------------------------------
@Explode(@Char(255):
男"
:
女"
用Messagebox判断用户做出的选择
answer%=Messagebox("
Doyouwanttocontinue?
36,"
Continue?
Ifanswer%=6Then
Messagebox"
YouclikedOK!
Else
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文档的域值
-------------------------------------------
改变当前文档中的Main_Status域值
DimworkspaceAsNewNotesUIWorkspace
DimuidocAsNotesUIDocument
DimdocAsNotesDocument
Setuidoc=workspace.CurrentDocument
Setdoc=uidoc.Document
doc.Main_Status="
5"
Calldoc.Save(True,True)
将当前文档置于编辑模式中
-----------------------------
@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"
"
Total"
Herewewilllistthetotalparticipantlist.
makingthefieldnulltoprintanewvalue.
Calluidoc.Save
Calluidoc.reload
Calluidoc.save
ForallentryIndoc.names
gtype=group(entry)'
CheckingwhethertheentryisagrouporPeople.
Ifgtype="
Group"
Then
tg=tg+1
groups(tg)=entry
Else
Calladdtolist(entry)'
Ifentryisaperson,thenaddingtoalistcalledPeople.
EndIf
EndForall
nowwehavegottwolistsoneis