LotusScript 代理的基本用法
Domino中使用LotusScript代理获取多值域的值

使用LotusScript获取多值域的值原理:文档中的域值是数组形式的。
多值域的值类似于一行多列的数组,下标从0开始。
假定域名为Employee,类型为多值文本域,文档中此域的值为:james,robin,alfred。
计划使用LS的得到返回值为:jamesrobinalfred。
方法1、直接获取strEmployee = doc.Employee(0) +doc.Employee(1) +doc.Employee(2)方法2、使用Evaluate声明Dim strEmployee AsVariantConst NotesMacro$ = "@Implode(Employee)"strEmployee = Evaluate(NotesMacro$,doc)MsgBoxCStr(strEmployee(0))方法3、使用GetItemValue方法Dim tname AsVarianttname = backdoc.GetItemValue("TComm3Name")MsgBox tnameForAll o In tnameMsgBoxCStr(o)EndForAll方法4、转化为数组处理Dim i,j AsIntegeri = 0arrEmployee = doc.GetItemValue("Employee ")For j=LBound(arrEmployee) ToUBound(arrEmployee)MsgBoxCStr(arrEmployee(i))i=i+1Next------------------例子--------------Dim WebStartDb As NotesDatabase '系统启动数据库Dim LinkDoc As NotesDocument '系统启动库中的链结文档Set WebStartDb=s.Getdatabase("", "weboa\woastart.nsf")Set LinkDoc = WebStartDb.GetDocumentByUNID(backdoc.DocID(0)) '根据链结文档ID从系统启动库中取链结文档IfNot LinkDoc IsNothingThenDim arrEmployee AsVariantDim strTComm3Name AsStringDim z,j AsIntegerz = 0strTComm3Name=""arrEmployee = backdoc.GetItemValue("TComm3Name")For j=LBound(arrEmployee) ToUBound(arrEmployee)'MsgBox "111:" & CStr(arrEmployee(z))strTComm3Name= strTComm3Name + CStr(arrEmployee(z))+";"z=z+1Next'MsgBox "strTComm3Name:" & strTComm3NameEndIfLinkDoc.IsTCommm=strTComm3NameCall LinkDoc.Save(True,True)。
LotusScript 代理的基本用法

LotusScript 代理的基本用法1、FTSearch搜索:Set dc=db.Ftsearch("name",0)'0位置为最大的查询数,0为所有匹配的文件FTSearch必须创建数据库索引Set doc=dc.Getfirstdocument()、2、Item:Set doc=dc.Getfirstdocument()While Not doc Is NothingForAll ritem In doc.ItemsMsgBox End ForAllWend3、取出特定的域Set doc=view.getFirstdocument()If doc.HashItem("yu") <> "" ThenSet item=doc.getfirstitem("yu")Set doc=view.getNextdocument(doc)End If4、使用文本属性If doc.Hashitem("yu") <> "" ThenSet doc=dc.Getfirstdocument()While Not doc Is NothingForAll itemValue In doc.yuitemValue = "Anonymous"End ForAllSet doc=dc.Getnextdocument(doc)WendEnd If5、获取域值:ForAll itemValue In doc.Getitemvalue("yu")6、添加域set item =new NotesItem(doc,"newYu",erName)Call doc.Appenditemvalue("newYu",Newvalue)7、替换值:1)、While Not doc Is NothingCall doc.Replaceitemvalue("resName","newValue")Set doc=dc.getnextdocument(doc)Wend2)、Set doc=dc.Getfirstdocument()While Not doc Is Nothing'Call doc.Replaceitemvalue("resName","newValue")Set item =doc.Getfirstitem("yu")While Not item Is NothingForAll resitems In doc.Itemsv(0)resitems="newVlaue"End ForAll= doc.Itemsv(0)Set item =doc.getnextitem(item)WendSet doc=dc.getnextdocument(doc)Wend8、拷贝域Set item =doc.Getitemvalue("name")call item.Copyitemtodocument(doc, "name")call doc.save(true,false)Call doc1.Copyallitems(doc2,true) ‘替换所有的9、删除指定的域:1)、For j=1 To dc.countSet item=doc.Getitemvalue("name")While Not item Is NothingCall item.Remove()Call doc.Save(true,false)WendSet doc=dc.Getnthdocument(j)Next2)、For j=1 To dc.countWhile Not doc.Hasitem("name")Call doc.Removeitem("name")Call doc.Save(True,false)WendSet doc=dc.Getnthdocument(j)Next10、RTF文本域的输出:Set item=doc.GetFirstItem("RtfYU")MsgBox item.Text11、在代理中使用公式:temp=Evaluate("@ReplaceSubstring(aa;bb;cc)",doc) 12、嵌入对象:ForAll csx In doc.EmbeddedobjectsEnd ForAllSet doc=dc.Getnthdocument(j)Next13、激活嵌入对象:Call doc.EmbeddedObjects(0).Activate(True)14、if的用法Set doc=dc.Getfirstdocument() If Not IsEmpty(db.Agents) Then ForAll agent In db.Agents MsgBox End ForAllEnd If。
LotusScript语言的基本知识

LotusScript 语言的基本知识一、概述LotusScript 是一种和Basic相兼容的面向对象的Scripting 环境,它具有强大的能够从事面向对象应用软件开发的语言范围,能够提供循环和分支的能力、数组以及访问Notes对象的能力。
判断Notes中什么时候使用LotusScript 或公式语言1)任何时候当执行该任务的函数或命令存在时,使用公式。
2)对于复杂的程序控制或循环,使用LotusScript 。
3)存取或操作储存的文档数据要使用LotusScript ,特别对于跨文档、跨数据库的存取。
4)若公式语言不能办到,则使用LotusScript在Notes应用程序中访问和操作对象需要三步进行:1.声明对象变量DIMDIM db As NotesDatabase2.实例化一个类将其赋值给对象变量SET db=New NotesDatabase( "Domestic" ,"Sales. nsf')3 •使用这个对象的方法或属性db.created '用来展现创建数据库时的日期和时间、NotesScript 中的数据元素NotesScript 中的常量Null ' 特殊值,代表数据遗失或空Empty ' 相当于"",也就是空串Noth ing ' 涉及变量的初始值,表示对象变量没有内容PI ' 圆周率True/False ' 分别为数值1和0数据类型Integer(整型)Long(长整型)Single(单精度型)Double(双精度型)Currency(货币型)String(字符串)运算符+ - * / <><> = Not And OR &常量和变量Dim address As String '定义变量address = "100 Ma in Street "'变量赋值Co nst address = "100 Mai n Street"'创建字符常量address通信输入和输出Dim response as Integerresponse = Inputbox( "Do you want to continue")'弹岀输入框输入Messagebox(respo nse) '弹岀输岀窗口输岀数据注释1 •单行注释:用Rem或'号2.多行注释:用%Ren和%EndRem% Rem '多行注释实例The first statement in this Script declares a variable myName.The second assi gn the value "Robert" to myName.The third statement display the value of myName. % End Rem数据类型转换Asc(String) 函数’将字符串转化为 ANSI 字符代码 CDate(Strin*) 函数'将字符串转化为日期型CBool(expressi on) 函数'将表达式转化为布尔型 CByte(expressi on) 函数'将表达式转化为字节型CCur(expressio n)函数'将表达式转化为货币型**bl(expressi on)函数’将表达式转化为双精度型 Chr (Integer) 函数'返回整数 AscII 码对象的字符,例如65表示AClnt (expression) 函数’将表达式转化为整型 CLn g(expressi on) CSn g(expressi on)CStr (expression)函数'将表达式转化为长整型 函数'将表达式转化为单精度型 函数'将表达式转化为字符串Hex (number) 函数'返回十六进制 Oct(number) 函数'返回八进制三、数组管理Dim MyDays(7) DimMyDay(1 to ReDim MyDay(1 UBou nd(MyDay,1) LBou nd(MyDay) LBou nd(MyDay,2)as String'声明一个数组一共7个元素,下标为0〜67) as String '声明一个数组下标为to 3)'重新设置数组的边界和维数,这里ReDim 用于定义动态数组'返回数组的上界,1表示若是多维数组,返回第一维的上界 '返回数组的下界'返回数组第2维的下界MyDay(1) = "Su nday"'给数组元素赋值四、语句1、IF ... End ifif balanee > 100 thenin terest = 0.35elsein terest = 0en dif2、Select caseSelectcase thisMo nthcase 1Resp onse = "Ja nuary"case 2 to 10 '也可以写成case 10,20,30 或caseis > 10 response = "Other" caseelseMessageBox(thisMo nth &"is in valid value")en dSelect3、Do...loops 禾口while... wendDowhile / until 条件'语句组loopDo'语句组loopwhile / until 条件while条件'语句组wend4、For...NextFor i = 1 to 5MyDays(i) = InputBox( "Enter your work days:")Next i5、ForAllForAll m in db.managers '循环显示数组db.managers 中的元素MessageBox(m)End ForAll[JavaScript]将Excel文件中的数据导入到表单2009-03-24 17:50:31标签:导入Excel休闲职场JavaScript版权声明:原创作品,如需转载,请与作者联系。
proxy-cheap使用教程

proxy-cheap使用教程Proxy-Cheap是一个提供HTTP/HTTPS和SOCKS5代理服务的网站。
它提供了一个易于使用的平台,使用户能够轻松获取和管理代理服务器。
本教程将向您展示如何使用Proxy-Cheap来获得代理和配置您的浏览器以使用这些代理。
步骤1:创建Proxy-Cheap账户步骤2:购买代理在Proxy-Cheap的仪表板上,选择合适的套餐。
Proxy-Cheap提供不同的套餐,以满足不同用户的需求。
选择你喜欢的套餐,点击“Buy”按钮,并按照界面上的指示完成购买。
步骤3:获取代理购买成功后,您将返回到Proxy-Cheap的仪表板。
在仪表板上,您可以找到您购买的代理服务器的列表,其中包括服务器的IP地址、端口号和验证凭证。
您可以根据自己的需求选择适合您的代理服务器。
步骤4:配置代理现在,您可以将代理配置在您的浏览器中,以便您可以通过代理服务器浏览Internet。
以下是如何在不同浏览器中配置代理的步骤:- Google Chrome:1. 在Chrome中,点击右上角的菜单按钮,并选择“Settings”。
2. 在设置页面中,滚动到底部并点击“Advanced”。
3. 在“System”部分,点击“Open proxy settings”。
4. 在Internet属性对话框的连接选项卡中,点击“LAN设置”。
5. 在局域网(LAN)设置窗口中,选中“使用代理服务器”复选框,并输入您在Proxy-Cheap仪表板中获得的代理服务器的IP地址和端口号。
6.点击“确定”保存您的更改,并关闭所有打开的窗口。
- Mozilla Firefox:1. 在Firefox中,点击右上角的菜单按钮,并选择“Options”。
2. 在选项页面中,选择“General”选项卡。
3. 在网络设置部分,点击“Settings”按钮。
4. 在连接设置窗口中,选择“手动代理配置”选项,并输入您在Proxy-Cheap仪表板中获得的代理服务器的IP地址和端口号。
3.7Lotus Domino LotusScript简介

LotusScript编程简介
LotusScript是一种现代的,面向对象的语言,它的语 法类似Basic。简单易学。 它和Domino的接口是通过预定义的的Domino对象类 (Domino Object Class)实现的。 Domino前端(front-end)对象类能够实现用户界面中 的所有控制,包括数据库、视图、文档和域等。
从UIWorkspace的对象开始获取UIDocument对象,修改其中 的变量,就可以修改文档的内容
通过后端类(back-end clas )操作那些不在用户界面 中的对象。
Байду номын сангаас
从NotesSession类开始,获取NotesDatabase的对象,然后获 取NotesDocument对象来修改文档。
Lotus Domino程序设计
———LotusScript简介
1
Lotus Domino程序设计
1. 2. 3. 4. 5. 6. 7. 8. 9.
编程概述 公式语言 公式在表单、域和操作中的应用 公式在视图中的应用 公式在代理中的应用 公式的其它用途 LotusScript编程简介 Domino对象模型 使用LotusScript访问数据库 、视图和文档
4
3
LotusScript有下面一些优点
1. 2. 3. 4. 5. 6. 7. 8.
Basic的超集。容易学习,可以进行复杂的逻辑控制,具有 现代语言的所有功能。 跨平台性,用LotusScript写的程序,可以运行在所有支持 的平台上。 面向对象,您可以使用LotusSciript操作DOM。也可以自定 义类。 所有的Lotus产品都支持LotusScript。支持OLE/COM。 可以和Domino @function一起工作。 由集成开发环境支持,可以调试。 可以通过LSX进行扩展,可以用C或者C++编写DLL扩展。 可以通过LS:DO连接外部数据库,例如:DB2,SQL Server。
数据导出-Domino浏览器端(网页端)数据导出实现

数据导出-Domino浏览器端(网页端)数据导出实现简介:本文介绍了两种导出domino数据的实现方法,一种使用代理,一种使用XPage。
一、使用代理导出数据导出代理使用LotusScript实现,基本原理涉及输出信息到网页,设置网页内容类型:1、print()方法可输出信息到网页2、设置输出HTML页面类型 为附件 “Content-Disposition:Attachment;”参考代码:%REMSub exportDataBSDescription: 数据导出,参数为导出的数据%END REMSub exportDataBS(dataTable As String)Dim attSetting As StringDim htmlHeader As String'Generate HTML PageattSetting="Content-Disposition:Attachment; filename=" & Format(Now,"YYYYMM DDHHMM") & ".xls" & Chr$(13)htmlHeader=|<html><head><meta content="text/html; charset=GB2312" http-equiv="Content-Type"/>| & Chr$(13) & _|<style type="text/css">body {background-color:transparent;font-family: Arial;}table {font-size:12;border: 1px black solid;border-collapse:collapse;}th,td {border: 1px black solid;}</style>| & _|</head><body>|Print attSetting & htmlHeader & dataTable & |</body></html>|End Sub3、通过对请求页面可获取GET和POST类型参数值参考代码:Set context=s.DocumentcontextREQUEST_CONTENT=context.Getitemvalue("REQUEST_CONTENT")(0) 'POST参数 Query_String_Decoded=context.Getitemvalue("Query_String_Decoded")(0) 'URL参数 '<<<<<<Get dataIf REQUEST_CONTENT<>"" Then'Export selected documentids=Trim(StrToken(REQUEST_CONTENT,"ids=",2))If ids<>"" ThenaryIDs=Split(ids,".")ForAll Noteid In aryIDsSet request=db.Getdocumentbyid(Noteid)If Not request Is Nothing ThentbHTML=tbHTML & getDocInfoHTML(request)ElsetbHTML=tbHTML & "<tr><td>" & Noteid & "</td><td>" & "File not fo und" & "</td></tr>"End If ' get request doc objectEnd ForAll 'loop note idsEnd IfElseIf Query_String_Decoded<>"" Then'Export as conditiondtType=GetParameter("type",Query_String_Decoded)startDate =GetParameter("start",Query_String_Decoded)endDate = GetParameter("end",Query_String_Decoded)matType=GetParameter("matType",Query_String_Decoded)'导出处理代码...ElsePrint "未获取到导出参数!"GoTo endSubEnd If其他辅助函数:* 获取URL参数Function GetParameter(strParamName As String, strQuery As String) As StringDim i As IntegerDim s As StringDim v As VariantGetParameter = ""i = InStr(UCase(strQuery),"&" & UCase(strParamName) & "=")If i <> 0 Thens = StrRight(Mid(strQuery, i),"=")If InStr(s, "&") Thens = StrLeft(s, "&")End Ifv = Evaluate("@UrlDecode(""Domino""; """ & s & """)")GetParameter = CStr(v(0))End IfEnd Function* 特殊字符转换Function PCDATA(ByVal phrase$) As String%REM当需要输出HTML格式文本时,可使用此函数将输出字符中的特殊字符转换为&#unicode格式%END REMOn Error GoTo errorHandlerDim begin%, found%, oldPhrase$If phrase$="" Then GoTo endSuboldPhrase= phraseDim a As LongDim ch As Stringphrase$=""For a=1 To Len(oldphrase)ch=Mid$(oldphrase,a,1)If Uni(ch)=32 Or Uni(ch)>47 And Uni(ch)<58 Or _ '0-9Uni(ch)>64 And Uni(ch)<91 Or _ 'A-ZUni(ch)>96 And Uni(ch)<123 Then 'a-zphrase$=phrase$ & chElsephrase$=phrase$ & "&#" & Uni(ch) & ";"End IfNextPCDATA = phraseendSub:Exit FunctionerrorHandler:PCDATA = oldPhraseResume endSubEnd Function二、通过设置XPage返回信息来导出数据设置导出功能的XPage,需设置Xpage的"rendered"属性为false,并在XPage的“afterRenderResponse()”事件中编写导出数据代码,使用SSJS编写,可以导出特殊字符(不用做处理),基本要点是:* 设置输出页面类型var exCon:javax.faces.context.ExternalContext = facesContext.getExternalContext();var writer:javax.faces.context.ResponseWriter = facesContext.getResponseWriter();var response:javax.servlet.http.HttpServletResponse = exCon.getResponse();response.setContentType("application/vnd.ms-excel;charset=utf-8");response.setHeader("Cache-Control", "no-cache");response.setHeader("Content-Disposition","attachment; filename=\"export.xls\"");* 设置输出页面及样式writer.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/></head>"); writer.write("<body style=\"background-color:transparent;font-family: Arial\">");.....writer.write("</body></html>");writer.endDocument();* 实现代码参考(输出指定视图内容)function getSerialTimeNo():string{var nt:Date=@Now();var y=@Year(nt);var mon=@Month(nt);var d=@Day(nt);var h=@Hour(nt);var m=@Minute(nt);var s=@Second(nt);var day=y+(@Length(mon)==1?"0":"")+mon+(@Length(d)==1?"0":"")+d;var time=(@Length(h)==1?"0":"")+h+(@Length(m)==1?"0":"")+m+(@Length(s)==1?"0":"")+s;return day+time;}function export2Excel(){try {//javax.faces.context.FacesContextvar exCon:javax.faces.context.ExternalContext = facesContext.getExternalContext();var writer:javax.faces.context.ResponseWriter = facesContext.getResponseWriter();var response:javax.servlet.http.HttpServletResponse = exCon.getResponse();response.setContentType("application/vnd.ms-excel;charset=utf-8");response.setHeader("Cache-Control", "no-cache");response.setHeader("Content-Disposition","attachment; filename=\"export"+getSerialTimeNo()+".xls\"");writer.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/></hea d>");writer.write("<body style=\"background-color:transparent;font-family: Arial\">");try{//////////////////////////输出代码开始///////////////////////////////页面参数传递var condition=sessionScope.parts;sessionScope.parts=null;var vw:NotesView = null;var vc:NotesViewEntryCollection = null;var ve:NotesViewEntry = null;var veTmp:NotesViewEntry = null;vw = database.getView("Request");vc = vw.getAllEntries();if(vc.getCount()>0){//输出表格及表格标题writer.write("<table border=\"1px black solid\">");writer.write("<tr>");var columns=vw.getColumnNames();for(j = 0 ; j < vw.getColumnCount() ; j++){writer.write("<th>" + columns[j] + "</th>");}writer.write("</tr>");//输出表格行:视图数据ve = vc.getFirstEntry();while (ve) {v = ve.getColumnValues();//条件判断if(condition==null || condition==v.elementAt(0)){writer.write("<tr>");for (i = 0; i < v.size(); i++) {writer.write("<td>"+v.elementAt(i).toString()+"</td>");}}veTmp = vc.getNextEntry(ve);ve.recycle();ve= veTmp;}writer.write("</table>");}else{//没有数据writer.write("No Data");}//////////////////////////输出代码结束/////////////////////////////}catch(e){writer.write("ERROR: "+e.toString());}writer.write("</body></html>");writer.endDocument();} catch (e) {print("sysExportToExcel: "+e);}}Use the context global variable to get an XSPContext object representing the current context.。
LotusScript语言知识

目录
概述
1.1 LotusScript介绍 1.2 LotusScript特点 1.3 使用位置与执行时机
数据元素
2.1 数据类型 2.2 常量和变量 2.3 数组
Domino 对象
3.1 Domino 对象介绍 3.2 Domino 对象的属性 3.3 Domino 对象的方法
语法
Domino 对象
3.1 Domino 对象的介绍 3.2 Domino 对象的属性 3.3 Domino 对象的方法
语法
4.1 常用语句 4.2 错误处理语句
数据类型
类型
数值范围
初始值
Integer(整型)
Long(长整型) Single(单精度型) Double(双精度型) Currency(货币型)
4.1 常用语句 4.2 错误处理语句
对象的介绍
Domino 对象 是一组用来表示一个Domino应用程序的class,每一个class 都有其属性和方法 主要分为两类class Back-end:NotesDatabase、NotesDocument等 Front-end:NotesUIWorkSpace、NotesUIView等
对象的介绍
Domino 对象包含模式 Domino对象包含层级是Domino对象类别分享的关系,也就 是有些类别会再包含其他类别。 示例 Domino Server -> Databases -> Notes -> items 所以若要存取Item Value,就要先存取Database与Notes
myName.The third statement display the value of myName.
%EndRem
lotus script 操纵word文档

Office 文档集数据库是以嵌入对象的方法嵌入word文档的,该文档在body域中,发送传真时,页眉、页脚发不出来,其他格式能正常发出来.而且可以做到不发传真封面,另外,这种方式也可以避免附件方式那样发出来还会出现一个附件图标,故现在的任务是如何往该文档中写内容了。
往该文档中写内容,有两种方式:一种是用VB写一个DLL,有关word文档的操作,包括插入一个表格、插入一个字符串、插页眉等等。
这些函数都放在Dll中,然后被lotus script调用。
另一种方式是用lotusscript 直接操纵该嵌入文档,但操纵嵌入文档的lotusscript语法与VB语法差异很大。
所能获得的例子代码和帮助都是VB语法,只能从lotusscript提取的ole对象库中去察看个函数的语法,至于个函数中的参数的意义只能从msdn中获得,而msdn中对参数的讲解也不是很详细,所有VB常量在lotusscript中没有定义,只能半猜半试的直接使用数值。
下面的例子是lotus script 操纵word文档:'获取嵌入文档的句丙Set thisdoc = source.getobject("oleobject"'设置该文档的页面设置的左边距为20个单位(象素)With thisdoc.pagesetup.leftmargin = 20End With'插入页眉(由于真正的页眉在传真时无法显示,这里的页眉是模拟的)'插入一幅图Set thispicture = thisdoc.shapes.Addpicture("d:\学习\cassiatb.jpg"'设置文字的插入点thisrangeSet thisrange = thisdoc.range(1,1)pageheadstring = "CAISSA Touristic GmbH" & Chr(10) & "HAMBURG·BEIJING·SHANGHAI·BARCELONA" & Chr(10) &Chr(10) & Chr(10)'插入一段文字:pageheadstringthisrange.insertbefore (pageheadstring)'获取一段文字:从字符1到24Set thisrange = thisdoc.range(1,24)'设置该段文字的属性:With thisrange.bold = True '加粗.ParagraphFormat.Alignment = 1'wdAlignParagraphCenter 行居中.font.size = 20 '字体大小为20End WithSet thisrange = thisdoc.range(25,59)With thisrange.bold = True.ParagraphFormat.Alignment = 1'wdAlignParagraphCenter.font.size = 16End With'thispicture.wrapformat.side = wdwrapright'设置图像属性With thispicture.wrapformat '环绕方式.type = wdwrappicture '类型为picture.side = wdwrapright '文字右环绕End With。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
LotusScript 代理的基本用法
1、FTSearch搜索:
Set dc=db.Ftsearch("name",0)
'0位置为最大的查询数,0为所有匹配的文件FTSearch必须创建数据库索引Set doc=dc.Getfirstdocument()、
2、Item:
Set doc=dc.Getfirstdocument()
While Not doc Is Nothing
ForAll ritem In doc.Items
MsgBox
End ForAll
Wend
3、取出特定的域
Set doc=view.getFirstdocument()
If doc.HashItem("yu") <> "" Then
Set item=doc.getfirstitem("yu")
Set doc=view.getNextdocument(doc)
End If
4、使用文本属性
If doc.Hashitem("yu") <> "" Then
Set doc=dc.Getfirstdocument()
While Not doc Is Nothing
ForAll itemValue In doc.yu
itemValue = "Anonymous"
End ForAll
Set doc=dc.Getnextdocument(doc)
Wend
End If
5、获取域值:
ForAll itemValue In doc.Getitemvalue("yu")
6、添加域
set item =new NotesItem(doc,"newYu",erName)
Call doc.Appenditemvalue("newYu",Newvalue)
7、替换值:
1)、While Not doc Is Nothing
Call doc.Replaceitemvalue("resName","newValue")
Set doc=dc.getnextdocument(doc)
Wend
2)、Set doc=dc.Getfirstdocument()
While Not doc Is Nothing
'Call doc.Replaceitemvalue("resName","newValue")
Set item =doc.Getfirstitem("yu")
While Not item Is Nothing
ForAll resitems In doc.Itemsv(0)
resitems="newVlaue"
End ForAll
= doc.Itemsv(0)
Set item =doc.getnextitem(item)
Wend
Set doc=dc.getnextdocument(doc)
Wend
8、拷贝域
Set item =doc.Getitemvalue("name")
call item.Copyitemtodocument(doc, "name")
call doc.save(true,false)
Call doc1.Copyallitems(doc2,true) ‘替换所有的9、删除指定的域:
1)、For j=1 To dc.count
Set item=doc.Getitemvalue("name")
While Not item Is Nothing
Call item.Remove()
Call doc.Save(true,false)
Wend
Set doc=dc.Getnthdocument(j)
Next
2)、For j=1 To dc.count
While Not doc.Hasitem("name")
Call doc.Removeitem("name")
Call doc.Save(True,false)
Wend
Set doc=dc.Getnthdocument(j)
Next
10、RTF文本域的输出:
Set item=doc.GetFirstItem("RtfYU")
MsgBox item.Text
11、在代理中使用公式:
temp=Evaluate("@ReplaceSubstring(aa;bb;cc)",doc) 12、嵌入对象:
ForAll csx In doc.Embeddedobjects
End ForAll
Set doc=dc.Getnthdocument(j)
Next
13、激活嵌入对象:
Call doc.EmbeddedObjects(0).Activate(True)
14、if的用法
Set doc=dc.Getfirstdocument() If Not IsEmpty(db.Agents) Then ForAll agent In db.Agents MsgBox
End ForAll
End If。