﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-guanxianfei-随笔分类-Lotus开发</title><link>http://www.blogjava.net/17learning/category/48641.html</link><description>我的博客：http://blog.sina.com.cn/17learning</description><language>zh-cn</language><lastBuildDate>Mon, 20 Feb 2012 19:45:23 GMT</lastBuildDate><pubDate>Mon, 20 Feb 2012 19:45:23 GMT</pubDate><ttl>60</ttl><item><title>Vb LotusScript中显示当前日期是当年的多少周？</title><link>http://www.blogjava.net/17learning/archive/2012/02/20/370372.html</link><dc:creator>guanxianfei</dc:creator><author>guanxianfei</author><pubDate>Mon, 20 Feb 2012 14:36:00 GMT</pubDate><guid>http://www.blogjava.net/17learning/archive/2012/02/20/370372.html</guid><wfw:comment>http://www.blogjava.net/17learning/comments/370372.html</wfw:comment><comments>http://www.blogjava.net/17learning/archive/2012/02/20/370372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/17learning/comments/commentRss/370372.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/17learning/services/trackbacks/370372.html</trackback:ping><description><![CDATA[LotusScript代码如下：<br /><br /><div><div>&nbsp;firstday=Evaluate(|@Weekday(@Date(| &amp; Year(today) &amp; |;1;1))|) &nbsp;'得到元旦是星期几</div><div>&nbsp;test=Evaluate(|@Date(|&amp; Year(Today) &amp;|;1;1)|) &nbsp; '得到第一天</div><div><span style="white-space:pre">	</span>days=CInt((today-test(0))) &nbsp; '用当前日期减掉第一天，计算出今年过了多少天。</div><div><span style="white-space:pre">	</span>jldays=days+firstday(0) &nbsp; '第一周不固定，所以将第一周有几天加到距离今天的日期上&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; weeks=CInt(StrLeft(CStr((days+firstday(0)-1)/7),".") )+1 &nbsp; '取到当前日期的周数+第一周 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;If(weeks&gt;9) Then&nbsp;</div><div><span style="white-space:pre">		</span>thisyearweek=CStr(weeks)</div><div><span style="white-space:pre">	</span>Else&nbsp;</div><div><span style="white-space:pre">		</span>thisyearweek="0"+Cstr(weeks)</div><div>&nbsp; &nbsp; End If</div><div><span style="white-space:pre">	</span>thisyearweekText=Year(today) &amp; "年第" &amp; thisyearweek &amp; "周"</div><div><span style="white-space:pre">	</span>MsgBox thisyearweekText</div></div><br />转载如下：<br /><br /><div><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><span style="font-size: small; ">说明一下，我这里是以星期日作为一周的开始<br />思路如下：<br />首先要计算今天离元旦相差多少天，然后除以7就得出今天离元旦多少个星期了。<br />这里要判断有无余数，如果有余数，则把商加1，就得出今天相距元旦多少个星期了。<br /></span><img src="http://hanhe-tech.com:8089/blog/images/code.gif" alt="程序代码" style="font-size: small; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; margin-top: 0px; margin-right: 2px; margin-bottom: -3px; margin-left: 0px; " /><span style="font-size: small; ">程序代码</span></p><div style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><div><span style="font-size: small; ">REM {获取元旦};<br />yuandan := @ToTime(@Text(@Year(@Now))+"-01-01");<br />x:= @Integer(((@Today-yuandan)/(3600*24)+1)/7);<br />y:=((@Today-yuandan)/(3600*24)+1)/7;<br />@If(y-x&gt;0;x+1;x)<br /></span></div></div><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><span style="font-size: small; ">但目前算出的只是今天相距元旦的星期数，并不是真正的周次。<br />因为每年元旦并不都是星期日，例如2006年的元旦是星期日，则本年的第一周是完整的一周（有7天）。<br />如果元旦不是星期日，则本年的第一周就只有（7-星期数）天。<br />例如2005年的元旦是星期六，则本年的第一周只有1天，1月2号就是第二周的开始了。&nbsp;<br />所以如果只用上面的四行代码，是不符合实际情况的。<br /><br />而且上面的代码还有bug，如果@Today是元旦，那会输出0。<br /><br />要计算真正的周次，就要从第二周开始算起。<br />第一周的天数是7减元旦的星期数，<br />如果元旦是星期日， @Weekday(yuandan)返回1，星期一返回2。<br />所以星期数要减一。代码如下：<br /><br /></span></p><div style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><div><span style="font-size: small; "><img src="http://hanhe-tech.com:8089/blog/images/code.gif" alt="程序代码" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; margin-top: 0px; margin-right: 2px; margin-bottom: -3px; margin-left: 0px; " />程序代码</span></div><div><br /><span style="font-size: small; ">yuandan := @ToTime(@Text(@Year(@Now))+"-01-01");&nbsp;<br />wd := @Weekday(yuandan);<br />t := 7-(wd-1);&nbsp;<br /></span></div></div><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><br /><br /><span style="font-size: small; ">用@Today 减元旦，再减第一周天数t，再加一，就是@Today到第二周开始的天数t1。<br />这里要做个判断，<br />If @Today 就是第一周里的，那得出的结果t1就会是负数，我们可以直接输出@Today 所在周次是第一周。<br />Else&nbsp;&nbsp;用 t1除以7，得出@Today 距离第二周有多少周。 然后加上1,就是加上第一周。就得出实际的周次了。<br /><br />这里还有个需求就是，一年365天，就等于52周加1天。每年的第53周与下一年的第一周其实是同一周，<br />所以这里的周报只算52周，如果算到第53周，就改为下一年的第一周。<br />具体实现就是把53改为1，然后把年份那个域的值加1。<br /></span></p><div style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><div><span style="font-size: small; "><img src="http://hanhe-tech.com:8089/blog/images/code.gif" alt="程序代码" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; margin-top: 0px; margin-right: 2px; margin-bottom: -3px; margin-left: 0px; " />程序代码</span></div><div><span style="font-size: small; ">@If(z=53;z:=1;z);</span></div></div><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><span style="font-size: small; ">完整代码如下：<br /><br /></span></p><div style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><div><span style="font-size: small; "><img src="http://hanhe-tech.com:8089/blog/images/code.gif" alt="程序代码" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; margin-top: 0px; margin-right: 2px; margin-bottom: -3px; margin-left: 0px; " />程序代码</span></div><div><br /><span style="font-size: small; ">REM {获取元旦};<br />yuandan := @ToTime(@Text(@Year(@Now))+"-01-01");<br />REM {判断元旦是否sunday,@Weekday(sunday)=1};<br />wd := @Weekday(yuandan);<br />@If(wd=1;<br />@Do(<br />x:= @Integer(((@Today-yuandan)/(3600*24)+1)/7);<br />y:=((@Today-yuandan)/(3600*24)+1)/7;<br />@If(y-x&gt;0;x+1;x)<br />);<br />@Do(<br />t := 7-(wd-1);<br />t1 := (@Today-yuandan)/(3600*24)-t+1;<br />@If(t1&gt;0;<br />@Do(<br />x:=@Integer(t1/7);<br />y:=t1/7;<br />@If(y-x&gt;0;z:=x+2;z:=x+1);<br />@If(z=53;z:=1;z);<br />z<br />);<br />@Do(<br />1<br />))<br />)<br />)</span></div><div><span style="font-size: small; ">1.计算当天所在周从周一到周日的天数</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />weekend:=@Adjust(weekstart;0;0;6;0;0;0);</span></div><div><span style="font-size: small; ">Text(weekstart)+"至"+@Text(weekend)</span></div><span style="font-size: large; "><div><span style="font-size: small; ">2.计算当天所在周每一天的日期<br />星期一:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />@Text(weekstart;"D2")</span></div><div><span style="font-size: small; ">星期二:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;1;0;0;0);<br />@Text(week;"D2")</span></div><div><span style="font-size: small; ">星期三:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;2;0;0;0);<br />@Text(week;"D2")</span></div><div><span style="font-size: small; ">星期四:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;3;0;0;0);<br />@Text(week;"D2")</span></div><div><span style="font-size: small; ">星期五:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;4;0;0;0);<br />@Text(week;"D2")</span></div><div><span style="font-size: small; ">星期六:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;5;0;0;0);<br />@Text(week;"D2")</span></div><div><span style="font-size: small; ">星期天:</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-2);0;0;0);<br />week:=@Adjust(weekstart;0;0;6;0;0;0);<br />@Text(week;"D2")</span></div><div><br /><span style="font-size: small; ">3.计算任意一周的周一至周日</span></div><div><span style="font-size: small; ">很简单，假设当周为CurrentWeekNo; 任意一周为:WeekNo;要计算任意一周的周一至周日公式就是：</span></div><div><span style="font-size: small; ">tmp:=CurrentWeekNo-WeekNo;</span></div><div><span style="font-size: small; ">step:=2-tmp*7;</span></div><div><span style="font-size: small; ">rem {任意一周的周一，得到周一，那二/三/四...就很轻松得到};</span></div><div><span style="font-size: small; ">weekstart:=@Adjust(@Today;0;0;-(@Weekday(@Today)-step);0;0;0);</span></div></span></div></div><img src ="http://www.blogjava.net/17learning/aggbug/370372.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/17learning/" target="_blank">guanxianfei</a> 2012-02-20 22:36 <a href="http://www.blogjava.net/17learning/archive/2012/02/20/370372.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>LotusScript  实现将文档统计后，根据厂家名称和文档创建时间计算总分</title><link>http://www.blogjava.net/17learning/archive/2012/02/20/370369.html</link><dc:creator>guanxianfei</dc:creator><author>guanxianfei</author><pubDate>Mon, 20 Feb 2012 14:30:00 GMT</pubDate><guid>http://www.blogjava.net/17learning/archive/2012/02/20/370369.html</guid><wfw:comment>http://www.blogjava.net/17learning/comments/370369.html</wfw:comment><comments>http://www.blogjava.net/17learning/archive/2012/02/20/370369.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/17learning/comments/commentRss/370369.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/17learning/services/trackbacks/370369.html</trackback:ping><description><![CDATA[<div><div>创建文档显示如下：<br /><span style="color: red; ">厂家名称 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 公司得分 &nbsp; &nbsp; &nbsp; &nbsp;时间</span><br />厂家A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 200 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@create<br />厂家B &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;300 &nbsp; &nbsp; &nbsp; &nbsp; @create<br />&nbsp;厂家a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 300 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@create<br /><br />显示结果：<br />&nbsp; &nbsp;&nbsp;<span style="color: #ff0000; ">厂家名称 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 公司得分 &nbsp; &nbsp; &nbsp; &nbsp;时间</span>&nbsp;&nbsp;<br /><div>&nbsp;厂家A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 500 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@create&nbsp;<br /><div>&nbsp; 厂家B &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 200 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@create&nbsp;<br />代码如下：</div></div></div><div>Sub Initialize</div><div><span style="white-space:pre">	</span>On &nbsp;Error &nbsp;GoTo &nbsp;errorHandle</div><div><span style="white-space:pre">	</span>Dim session As New NotesSession</div><div><span style="white-space:pre">	</span>Dim db As NotesDatabase</div><div><span style="white-space:pre">	</span>Dim view As NotesView</div><div><span style="white-space:pre">	</span>Dim doc As NotesDocument &nbsp;</div><div><span style="white-space:pre">	</span>Dim valueCategory As String</div><div><span style="white-space:pre">	</span>Dim nowTime As &nbsp; Variant<span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>Set db = session.CurrentDatabase</div><div><span style="white-space:pre">	</span>Set view = db.GetView("showCategory")</div><div><span style="white-space:pre">	</span>Set doc = view.GetFirstDocument()</div><div>&nbsp; &nbsp; &nbsp; If Not doc Is Nothing Then</div><div><span style="white-space:pre">	</span> &nbsp; &nbsp; &nbsp; valueCategory=CStr(doc.sortCategory(0)) &nbsp; &nbsp; &nbsp;&#8216;从前台获得显示条件</div><div>&nbsp; &nbsp; &nbsp; Else</div><div><span style="white-space:pre">	</span> &nbsp; &nbsp; &nbsp; valueCategory="总排行" &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; End If</div><div><span style="white-space:pre">	</span>While Not(doc Is Nothing)</div><div><span style="white-space:pre">		</span>Call doc.Remove(True)</div><div><span style="white-space:pre">		</span>Set doc = view.GetFirstDocument()</div><div><span style="white-space:pre">	</span>Wend</div><div><span style="white-space:pre">	</span>Call showContent(valueCategory)</div><div><span style="white-space:pre">	</span>Exit Sub</div><div>&nbsp;errorHandle:</div><div><span style="white-space:pre">	</span>MsgBox &nbsp;"showFddl &nbsp;error："+CStr(Erl)+"行"+Error</div><div><span style="white-space:pre">	</span>Exit Sub</div><div>End Sub</div><div></div><div></div><div></div><div>Function &nbsp;showContent(valueCategory As String)</div><div><span style="white-space:pre">	</span>On Error GoTo eHandle</div><div><span style="white-space:pre">	</span>Dim s As New NotesSession</div><div><span style="white-space:pre">	</span>Dim db As NotesDatabase,view As NotesView</div><div><span style="white-space:pre">	</span>Dim entryc As NotesViewEntryCollection,entryA As NotesViewEntry,entryB As NotesViewEntry</div><div><span style="white-space:pre">	</span>Dim nav As NotesViewNavigator</div><div><span style="white-space:pre">	</span>Dim value As Integer &nbsp; &nbsp;'每个评分</div><div><span style="white-space:pre">	</span>Dim comcount As Integer '一个公司的评分次数</div><div><span style="white-space:pre">	</span>Dim comarr &nbsp;As Variant ,valuearr &nbsp;As Variant &nbsp;'公司和评分数组</div><div><span style="white-space:pre">	</span>Dim entry As NotesViewEntry</div><div><span style="white-space:pre">	</span>Dim com As String</div><div><span style="white-space:pre">	</span>Dim comnew As String</div><div><span style="white-space:pre">	</span>Dim comlast As String&nbsp;</div><div><span style="white-space:pre">	</span>Dim comString As String</div><div><span style="white-space:pre">	</span>Dim &nbsp;valueString As String</div><div><span style="white-space:pre">	</span>Dim count As Integer</div><div><span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>Dim doc,doc2,doc3 As NotesDocument<span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>Dim valueb As &nbsp;Integer</div><div><span style="white-space:pre">	</span>Dim &nbsp;oldtime As &nbsp;String</div><div><span style="white-space:pre">	</span>Dim &nbsp;nowTime As String<span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>Dim rview As NotesView</div><div><span style="white-space:pre">	</span>Dim &nbsp;rdoc As NotesDocument</div><div><span style="white-space:pre">	</span>Dim docTime1,docTime2,docTime3 As String '保存的文档时间</div><div><span style="white-space:pre">	</span>'清空视图</div><div><span style="white-space:pre">	</span>Set db=s.Currentdatabase</div><div><span style="white-space:pre">	</span>Set rview= db.GetView("s_showFddl")</div><div><span style="white-space:pre">	</span>Set rdoc = rview.GetFirstDocument()</div><div><span style="white-space:pre">	</span>While Not(rdoc Is Nothing)</div><div><span style="white-space:pre">		</span>Call rdoc.Remove(True)</div><div><span style="white-space:pre">		</span>Set rdoc = rview.getfirstdocument()</div><div><span style="white-space:pre">	</span>Wend</div><div><span style="white-space:pre">	</span>'遍历视图</div><div><span style="white-space:pre">	</span>Set db=s.currentdatabase</div><div><span style="white-space:pre">	</span>Set view = db.getview("showFddl")<span style="white-space:pre">		</span></div><div><span style="white-space:pre">	</span>Set nav=view.createviewnav() &nbsp; '遍历器</div><div><span style="white-space:pre">	</span>Set entryA=nav.getfirst<span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>comcount=0</div><div><span style="white-space:pre">	</span>If Not entryA Is Nothing Then</div><div><span style="white-space:pre">		</span>com = entryA.Columnvalues(1) &nbsp;'得到公司名称</div><div><span style="white-space:pre">		</span>value =CInt(entryA.Columnvalues(0))<span style="white-space:pre">		</span>'得到总分</div><div><span style="white-space:pre">		</span>oldtime =entryA.Columnvalues(2) &nbsp;'得到文档的时间<span style="white-space:pre">	</span></div><div><span style="white-space:pre">		</span>comcount=1</div><div><span style="white-space:pre">		</span>comlast=com</div><div><span style="white-space:pre">	</span>If valueCategory="本周排行" &nbsp;Then &nbsp; '根据条件进行帅选</div><div><span style="white-space:pre">			</span>firstday=Evaluate(|@Weekday(@Date(| &amp; Year(Today) &amp; |;1;1))|)</div><div><span style="white-space:pre">			</span>test=Evaluate(|@Date(|&amp; Year(Today) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">			</span>days=CInt((today-test(0))) &nbsp;</div><div>&nbsp; &nbsp; &nbsp;<span style="white-space:pre">		</span>weeks=CInt(StrLeft(CStr((days+firstday(0)-1)/7),".") )+1</div><div><span style="white-space:pre">			</span>If(weeks&gt;9) Then</div><div><span style="white-space:pre">				</span>thisyearweek=CStr(weeks)</div><div><span style="white-space:pre">			</span>Else&nbsp;</div><div><span style="white-space:pre">				</span>thisyearweek="0"+Cstr(weeks)</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">			</span>nowTime=CStr(Year(Today)&amp;"#"&amp; thisyearweek)</div><div><span style="white-space:pre">			</span>tempOldTime=CDat(Format(oldtime,"yyyy-m-d"))</div><div><span style="white-space:pre">			</span>firstday2=Evaluate(|@Weekday(@Date(| &amp; Year(oldtime) &amp; |;1;1))|)</div><div><span style="white-space:pre">			</span>test2=Evaluate(|@Date(|&amp;Year(oldtime) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">			</span>days2=CInt(tempOldTime-test2(0)) &nbsp;</div><div><span style="white-space:pre">		</span> &nbsp; &nbsp;weeks2=CInt(StrLeft(CStr((days2+firstday2(0)-1)/7),".") )+1</div><div><span style="white-space:pre">			</span>If(weeks2&gt;9) Then</div><div><span style="white-space:pre">				</span>thisyearweek2=CStr(weeks2)</div><div><span style="white-space:pre">			</span>Else&nbsp;</div><div><span style="white-space:pre">				</span>thisyearweek2="0"+Cstr(weeks2)</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">			</span>docTime1=CStr(Year(oldTime))+"#"+CStr(thisyearweek2)<span style="white-space:pre">	</span></div><div><span style="white-space:pre">		</span>ElseIf &nbsp; valueCategory="本月排行" Then</div><div><span style="white-space:pre">			</span>nowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">			</span>docTime1=CStr(Year(oldtime))+"#"+CStr(Month(oldtime))</div><div><span style="white-space:pre">		</span>ElseIf &nbsp; valueCategory="本季度排行" Then</div><div><span style="white-space:pre">			</span>tempNowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">			</span>rNowTime=StrRight(tempNowTime,"#")<span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>lNowTime=StrLeft(tempNowTime,"#")<span style="white-space:pre">			</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempDocTime1=CStr(Year(oldtime))+"#"+CStr(Month(oldtime))<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>RDocTime1=StrRight(tempDocTime1,"#")<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>lDocTime1=StrLeft(tempDocTime1,"#")</div><div><span style="white-space:pre">			</span>If <span style="white-space:pre">	</span>lNowTime=lDocTime1 &nbsp; &nbsp;Then</div><div><span style="white-space:pre">				</span>If (0&lt;rNowTime&lt;4) And (0&lt;rDocTime1&lt;4) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime1="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (4&lt;=rNowTime&lt;7) And (4&lt;=rDocTime1&lt;7) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime1="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (7&lt;=rNowTime&lt;10) And (7&lt;=rDocTime1&lt;10) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime1="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (10&lt;=rNowTime&lt;13) And (10&lt;=rDocTime1&lt;13) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime1="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">					</span></div><div><span style="white-space:pre">			</span>Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowTime="=="</div><div><span style="white-space:pre">				</span>docTime1="!==" &nbsp; <span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">		</span> &nbsp; ElseIf &nbsp; valueCategory="总排行" Then<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>nowtime=""</div><div><span style="white-space:pre">	</span> &nbsp; &nbsp;<span style="white-space:pre">	</span>docTime1=""</div><div><span style="white-space:pre">		</span>End If</div><div><span style="white-space:pre">		</span>Set entryB = nav.getnext(entryA)</div><div><span style="white-space:pre">		</span>If Not entryB Is Nothing Then&nbsp;</div><div><span style="white-space:pre">			</span>comnew = entryB.Columnvalues(1)</div><div><span style="white-space:pre">			</span>If Not comnew=comlast Then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="white-space:pre">		</span></div><div><span style="white-space:pre">				</span>If(nowtime=docTime1) &nbsp;Then &nbsp; &nbsp;'和当前时间做对比</div><div><span style="white-space:pre">					</span>Set doc = New NotesDocument(db) &nbsp;'保存新文档显示到s_showWhxf视图中</div><div><span style="white-space:pre">					</span>doc.form="pjSumfile"</div><div><span style="white-space:pre">					</span>doc.S_unitName=com</div><div><span style="white-space:pre">					</span>doc.S_no1=value</div><div><span style="white-space:pre">					</span>doc.S_time=Evaluate("@Now")</div><div><span style="white-space:pre">					</span>doc.S_category="电缆防盗器厂家"</div><div><span style="white-space:pre">					</span>Call doc.Save(True,True)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; comString=comString+"#:"+com &nbsp; &nbsp; &nbsp; '公司名称字符串</div><div><span style="white-space:pre">					</span>valueString=valueString+"#"+CStr(value) '公司评分字符串</div><div>&nbsp; &nbsp; &nbsp;<span style="white-space:pre">			</span>End If&nbsp;</div><div><span style="white-space:pre">					</span>com=""</div><div><span style="white-space:pre">					</span>value=0</div><div><span style="white-space:pre">					</span>comcount=0</div><div><span style="white-space:pre">					</span>comnew=""</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">		</span>Else&nbsp;</div><div><span style="white-space:pre">			</span>If(nowTime=docTime1) &nbsp;Then</div><div><span style="white-space:pre">				</span>Set doc = New NotesDocument(db)</div><div><span style="white-space:pre">				</span>doc.form="pjSumfile"</div><div><span style="white-space:pre">				</span>doc.S_unitName=com</div><div><span style="white-space:pre">				</span>doc.S_no1=value</div><div><span style="white-space:pre">				</span>doc.S_time=Evaluate("@Now")</div><div><span style="white-space:pre">				</span>doc.S_category="电缆防盗器厂家"</div><div><span style="white-space:pre">				</span>Call doc.Save(True,True)</div><div><span style="white-space:pre">			</span>End If<span style="white-space:pre">			</span></div><div><span style="white-space:pre">		</span>End If</div><div><span style="white-space:pre">	</span>End If</div><div><span style="white-space:pre">	</span>If Not (nowTime=docTime1) &nbsp; Then&nbsp;</div><div><span style="white-space:pre">		</span>value=0 '第一个文档的时间</div><div><span style="white-space:pre">		</span>comcount=0</div><div><span style="white-space:pre">	</span>End If<span style="white-space:pre">	</span></div><div><span style="white-space:pre">	</span>While Not entryB Is Nothing</div><div><span style="white-space:pre">		</span>com = entryB.Columnvalues(1)<span style="white-space:pre">	</span></div><div><span style="white-space:pre">		</span>valueNext=entryB.Columnvalues(2)</div><div><span style="white-space:pre">		</span>If &nbsp;valueCategory="本月排行" Then</div><div><span style="white-space:pre">			</span>nowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">			</span>docTime2=CStr(Year(valueNext))+"#"+CStr(Month(valueNext))</div><div><span style="white-space:pre">		</span>ElseIf valueCategory="本周排行" Then</div><div><span style="white-space:pre">			</span>firstday=Evaluate(|@Weekday(@Date(| &amp; Year(Today) &amp; |;1;1))|)</div><div><span style="white-space:pre">			</span>test=Evaluate(|@Date(|&amp; Year(Today) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">			</span>days=CInt((today-CDat(test(0)))) &nbsp;</div><div><span style="white-space:pre">			</span>weeks=CInt(StrLeft(CStr((days+firstday(0)-1)/7),".") )+1</div><div><span style="white-space:pre">			</span>If(weeks&gt;9) Then</div><div><span style="white-space:pre">				</span>thisyearweek=CStr(weeks)</div><div><span style="white-space:pre">			</span>Else&nbsp;</div><div><span style="white-space:pre">				</span>thisyearweek="0"+Cstr(weeks)</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">			</span>nowTime=CStr(Year(Today)&amp;"#"&amp; thisyearweek)</div><div><span style="white-space:pre">			</span>tempOldTime2=CDat(Format(valueNext,"yyyy-m-d"))</div><div><span style="white-space:pre">			</span>firstday2=Evaluate(|@Weekday(@Date(| &amp; Year(valueNext) &amp; |;1;1))|)</div><div><span style="white-space:pre">			</span>test2=Evaluate(|@Date(|&amp;Year(valueNext) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">			</span>days2=CInt(CDat(tempOldTime2)-CDat(test2(0))) &nbsp;</div><div><span style="white-space:pre">			</span>weeks2=CInt(StrLeft(CStr((days2+firstday2(0)-1)/7),".") )+1</div><div><span style="white-space:pre">			</span>If(weeks2&gt;9) Then</div><div><span style="white-space:pre">				</span>thisyearweek2=CStr(weeks2)</div><div><span style="white-space:pre">			</span>Else&nbsp;</div><div><span style="white-space:pre">				</span>thisyearweek2="0"+Cstr(weeks2)</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">			</span>docTime2=CStr(Year(valueNext))+"#"+CStr(thisyearweek2)</div><div><span style="white-space:pre">		</span> &nbsp; ElseIf &nbsp; valueCategory="本季度排行" Then</div><div><span style="white-space:pre">			</span>tempNowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">			</span>rNowTime=StrRight(tempNowTime,"#")<span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>lNowTime=StrLeft(tempNowTime,"#")<span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>tempDocTime2=CStr(Year(valueNext))+"#"+CStr(Month(valueNext))<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>RDocTime2=StrRight(tempDocTime2,"#")<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>lDocTime2=StrLeft(tempDocTime2,"#")</div><div><span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>If <span style="white-space:pre">	</span>lNowTime=lDocTime2 &nbsp; &nbsp;Then</div><div><span style="white-space:pre">				</span>If (0&lt;rNowTime&lt;4) And (0&lt;rDocTime2&lt;4) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime2="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (4&lt;=rNowTime&lt;7) And (4&lt;=rDocTime2&lt;7) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime2="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (7&lt;=rNowTime&lt;10) And (7&lt;=rDocTime2&lt;10) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime2="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>If (10&lt;=rNowTime&lt;13) And (10&lt;=rDocTime2&lt;13) Then</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime2="=="&nbsp;</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span></div><div><span style="white-space:pre">			</span>Else</div><div><span style="white-space:pre">				</span>nowTime="=="</div><div><span style="white-space:pre">				</span>docTime2="!==" &nbsp; <span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">		</span>ElseIf &nbsp; valueCategory="总排行" Then<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span> nowtime=""</div><div><span style="white-space:pre">			</span> docTime2=""</div><div><span style="white-space:pre">		</span>End If</div><div><span style="white-space:pre">		</span></div><div><span style="white-space:pre">		</span></div><div><span style="white-space:pre">		</span>If( nowTime=docTime2) &nbsp; Then</div><div><span style="white-space:pre">			</span>value=value+entryB.Columnvalues(0) '第二个文档的值<span style="white-space:pre">		</span></div><div><span style="white-space:pre">		</span> &nbsp; &nbsp;comcount=comcount+1 &nbsp; '有几个相同的值<span style="white-space:pre">			</span></div><div><span style="white-space:pre">		</span>End If<span style="white-space:pre">	</span></div><div><span style="white-space:pre">		</span>If(nowTime=docTime3) &nbsp;Then&nbsp;</div><div><span style="white-space:pre">	</span> &nbsp; &nbsp; <span style="white-space:pre">	</span>valueb=valueb+entryB.Columnvalues(0) '最后一个文档的值</div><div><span style="white-space:pre">		</span>End If</div><div><span style="white-space:pre">		</span>comlast=com</div><div><span style="white-space:pre">		</span>Set entryB = nav.getnext(entryB)</div><div><span style="white-space:pre">		</span>If Not entryB Is Nothing Then</div><div><span style="white-space:pre">			</span>comnew = entryB.Columnvalues(1)</div><div><span style="white-space:pre">			</span>If &nbsp; valueCategory="本月排行" Then</div><div><span style="white-space:pre">				</span>nowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">				</span>docTime3=CStr(Year(valueNext))+"#"+CStr(Month(valueNext))</div><div><span style="white-space:pre">			</span>ElseIf valueCategory="本周排行" Then</div><div><span style="white-space:pre">				</span>firstday=Evaluate(|@Weekday(@Date(| &amp; Year(Today) &amp; |;1;1))|)</div><div><span style="white-space:pre">				</span>test=Evaluate(|@Date(|&amp; Year(Today) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">				</span>days=CInt((today-test(0))) &nbsp;</div><div><span style="white-space:pre">				</span>weeks=CInt(StrLeft(CStr((days+firstday(0)-1)/7),".") )+1</div><div><span style="white-space:pre">				</span>If(weeks&gt;9) Then</div><div><span style="white-space:pre">					</span>thisyearweek=CStr(weeks)</div><div><span style="white-space:pre">				</span>Else&nbsp;</div><div><span style="white-space:pre">					</span>thisyearweek="0"+Cstr(weeks)</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>nowTime=CStr(Year(Today)&amp;"#"&amp; thisyearweek)<span style="white-space:pre">				</span></div><div><span style="white-space:pre">				</span>tempOldTime=CDat(Format(valueNext,"yyyy-m-d"))</div><div><span style="white-space:pre">				</span>firstday3=Evaluate(|@Weekday(@Date(| &amp; Year(valueNext) &amp; |;1;1))|)</div><div><span style="white-space:pre">				</span>test3=Evaluate(|@Date(|&amp;Year(valueNext) &amp;|;1;1)|)'第一天（元旦）</div><div><span style="white-space:pre">				</span>days3=CInt(tempOldTime-test3(0)) &nbsp;</div><div><span style="white-space:pre">				</span>weeks3=CInt(StrLeft(CStr((days3+firstday3(0)-1)/7),".") )+1</div><div><span style="white-space:pre">				</span>If(weeks3&gt;9) Then</div><div><span style="white-space:pre">					</span>thisyearweek3=CStr(weeks3)</div><div><span style="white-space:pre">				</span>Else&nbsp;</div><div><span style="white-space:pre">					</span>thisyearweek3="0"+Cstr(weeks3)</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>docTime3=CStr(Year(valueNext))+"#"+CStr(thisyearweek3)<span style="white-space:pre">	</span></div><div><span style="white-space:pre">			</span> &nbsp;ElseIf &nbsp; valueCategory="本季度排行" Then</div><div><span style="white-space:pre">				</span>tempNowTime=CStr(Year(Now))+"#"+CStr(Month(Now))</div><div><span style="white-space:pre">				</span>rNowTime=StrRight(tempNowTime,"#")<span style="white-space:pre">			</span></div><div><span style="white-space:pre">				</span>lNowTime=StrLeft(tempNowTime,"#")<span style="white-space:pre">			</span></div><div><span style="white-space:pre">				</span>tempDocTime3=CStr(Year(valueNext))+"#"+CStr(Month(valueNext))<span style="white-space:pre">	</span></div><div><span style="white-space:pre">				</span>rDocTime3=StrRight(tempDocTime3,"#")<span style="white-space:pre">	</span></div><div><span style="white-space:pre">				</span>lDocTime3=StrLeft(tempDocTime3,"#")</div><div><span style="white-space:pre">				</span></div><div><span style="white-space:pre">				</span>If <span style="white-space:pre">	</span>lNowTime=lDocTime3 &nbsp; &nbsp;Then</div><div><span style="white-space:pre">					</span>If (0&lt;rNowTime&lt;4) And (0&lt;rDocTime3&lt;4) Then</div><div><span style="white-space:pre">						</span>nowTime="=="</div><div><span style="white-space:pre">						</span>docTime3="=="&nbsp;</div><div><span style="white-space:pre">					</span>End If</div><div><span style="white-space:pre">					</span>If (4&lt;=rNowTime&lt;7) And (4&lt;=rDocTime3&lt;7) Then</div><div><span style="white-space:pre">						</span>nowTime="=="</div><div><span style="white-space:pre">						</span>docTime3="=="&nbsp;</div><div><span style="white-space:pre">					</span>End If</div><div><span style="white-space:pre">					</span>If (7&lt;=rNowTime&lt;10) And (7&lt;=rDocTime3&lt;10) Then</div><div><span style="white-space:pre">						</span>nowTime="=="</div><div><span style="white-space:pre">						</span>docTime3="=="&nbsp;</div><div><span style="white-space:pre">					</span>End If</div><div><span style="white-space:pre">					</span>If (10&lt;=rNowTime&lt;13) And (10&lt;=rDocTime3&lt;13) Then</div><div><span style="white-space:pre">						</span>nowTime="=="</div><div><span style="white-space:pre">						</span>docTime3="=="&nbsp;</div><div><span style="white-space:pre">					</span>End If</div><div><span style="white-space:pre">					</span></div><div><span style="white-space:pre">				</span>Else</div><div><span style="white-space:pre">					</span>nowTime="=="</div><div><span style="white-space:pre">					</span>docTime3="!==" &nbsp; <span style="white-space:pre">	</span></div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">			</span>ElseIf &nbsp; valueCategory="总排行" Then<span style="white-space:pre">	</span></div><div><span style="white-space:pre">				</span>nowtime=""</div><div><span style="white-space:pre">				</span>docTime3=""</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>If Not comnew=comlast Then &nbsp; '公司变了</div><div><span style="white-space:pre">				</span>If(nowTime=docTime2) &nbsp;Then</div><div><span style="white-space:pre">					</span>Set doc2 = New NotesDocument(db)</div><div><span style="white-space:pre">					</span>doc2.form="pjSumfile"</div><div><span style="white-space:pre">					</span>doc2.S_unitName=com</div><div><span style="white-space:pre">					</span>doc2.S_no1=value/comcount</div><div><span style="white-space:pre">					</span>doc2.S_time=Evaluate("@Now")</div><div><span style="white-space:pre">					</span>doc2.S_category="电缆防盗器厂家"</div><div><span style="white-space:pre">					</span>Call doc2.Save(True,True)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comString=comString+"#:"+com&nbsp;</div><div><span style="white-space:pre">					</span>valueString=valueString+"#"+Cstr(value/comcount)</div><div><span style="white-space:pre">					</span>valueb=CInt(entryB.Columnvalues(0))</div><div><span style="white-space:pre">				</span>End If</div><div><span style="white-space:pre">				</span>com=""</div><div><span style="white-space:pre">				</span>value=0</div><div><span style="white-space:pre">				</span>valueb=0</div><div><span style="white-space:pre">				</span>comcount=0</div><div><span style="white-space:pre">				</span>comnew=""</div><div><span style="white-space:pre">				</span>docTime2=""</div><div><span style="white-space:pre">				</span>docTime3=""</div><div><span style="white-space:pre">			</span>End If<span style="white-space:pre">				</span></div><div><span style="white-space:pre">		</span>Else &nbsp; &nbsp; &nbsp;'最后一个公司</div><div><span style="white-space:pre">			</span>If(nowTime=docTime3) &nbsp;Then&nbsp;</div><div><span style="white-space:pre">				</span>Set doc3 = New NotesDocument(db)</div><div><span style="white-space:pre">				</span>doc3.form="pjSumfile"</div><div><span style="white-space:pre">				</span>doc3.S_unitName=com</div><div><span style="white-space:pre">				</span>doc3.S_no1=valueb/comcount</div><div><span style="white-space:pre">				</span>doc3.S_time=Evaluate("@Now")</div><div><span style="white-space:pre">				</span>doc3.S_category="电缆防盗器厂家"</div><div><span style="white-space:pre">				</span>Call doc3.Save(True,True)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comString=comString+"#:"+com</div><div><span style="white-space:pre">				</span>valueString=valueString+"#"+Cstr(valueb/comcount)</div><div><span style="white-space:pre">			</span>End If</div><div><span style="white-space:pre">		</span>End If<span style="white-space:pre">	</span> &nbsp;<span style="white-space:pre">			</span></div><div><span style="white-space:pre">	</span>Wend</div><div><span style="white-space:pre">	</span>'comarr=Split(StrRight(comString,"#"),"#")</div><div><span style="white-space:pre">	</span>'valuearr=Split(StrRight(valueString,"#"),"#")</div><div><span style="white-space:pre">	</span>Exit Function&nbsp;</div><div>eHandle:</div><div><span style="white-space:pre">	</span>MsgBox &nbsp;"sumFddl showContent错误"+CStr(Erl)+"行"+Error</div><div><span style="white-space:pre">	</span>Exit Function&nbsp;</div><div>End Function</div></div><img src ="http://www.blogjava.net/17learning/aggbug/370369.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/17learning/" target="_blank">guanxianfei</a> 2012-02-20 22:30 <a href="http://www.blogjava.net/17learning/archive/2012/02/20/370369.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Lotus Domino 实现将视图中的数据导出到Excel中</title><link>http://www.blogjava.net/17learning/archive/2012/01/05/367933.html</link><dc:creator>guanxianfei</dc:creator><author>guanxianfei</author><pubDate>Thu, 05 Jan 2012 09:15:00 GMT</pubDate><guid>http://www.blogjava.net/17learning/archive/2012/01/05/367933.html</guid><wfw:comment>http://www.blogjava.net/17learning/comments/367933.html</wfw:comment><comments>http://www.blogjava.net/17learning/archive/2012/01/05/367933.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/17learning/comments/commentRss/367933.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/17learning/services/trackbacks/367933.html</trackback:ping><description><![CDATA[<p>1、简单方法：<br />问题automation服务器不能创建对象<br />解决办法：如果javascript脚本中报这个错误是因为<span style="color: red">IE的安全设置不允许运行未标记为</span><span style="color: red">安全的activeX控件 </span>更改IE的安全设置，把相应的选项打开即可。</p>
<p>Sub Initialize<br />Dim s As New NotesSession<br />Dim curdoc As NotesDocument<br />Dim curdb As NotesDatabase<br />Dim vw As NotesView<br />Dim doc As NotesDocument<br />Dim et As NotesViewEntry<br />Dim i<br />i=3<br />Set curdb=s.CurrentDatabase<br />Set vw=curdb.GetView("UmSafetyInfo")<br />Set doc=vw.GetFirstDocument<br />'Dim x As Variant<br /><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#39;&#116;&#101;&#109;&#112;&#115;&#116;&#114;&#61;&#124;&#64;&#110;&#97;&#109;&#101;&#40;&#91;&#79;&#85;&#50;&#93;&#59;&#39;&#124;&#43;&#99;&#117;&#114;&#100;&#111;&#99;&#46;&#114;&#101;&#109;&#111;&#116;&#101;&#95;&#117;&#115;&#101;&#114;&#40;&#48;&#41;&#43;&#124;&#39;">'tempstr=|@name([OU2];'|+curdoc.remote_user(0)+|'</a>)|<br />'x=Evaluate(tempstr)<br />'Msgbox x(0)<br />Print |<br />&lt;script language=javascript&gt;<br />var xls = new ActiveXObject ( "Excel.Application" );<br />//xls.visible = "false";<br />var xlBook = xls.Workbooks.Add;<br />var xlsheet = xlBook.Worksheets(1);<br />xls.Cells.Select;<br />xlsheet.Cells(2,1).Value="部门";<br />xlsheet.Cells(2,2).Value="姓名";<br />xlsheet.Cells(2,3).Value="分机";<br />xlsheet.Cells(2,4).Value="移动电话";<br />xlsheet.Cells(2,5).Value="手机小号";<br />xlsheet.Cells(2,6).Value="电子邮件";<br />xlsheet.Cells(2,7).Value="直拨电话";<br />xlsheet.Rows(2).Font.Bold=1;<br />xlsheet.Rows(2).Font.Name="宋体";<br />xlsheet.Range("A1","G1").MergeCells = 1;<br />xlsheet.Cells(1,1).Value="某某公司";<br />xlsheet.Range("A1","A1").HorizontalAlignment = 3<br />//xlsheet.Range("A2","G2").ColorIndex = 48<br />xlsheet.Rows(1).Font.Bold=1;<br />xlsheet.Rows(1).Font.Name="黑体";<br />xlsheet.Rows(1).Font.Size=16;<br />xlsheet.Rows(2).Font.Size=9;<br />xlsheet.Columns(1).ColumnWidth = 25<br />xlsheet.Columns(2).HorizontalAlignment=3<br />xlsheet.Columns(3).HorizontalAlignment=3<br />xlsheet.Columns(4).HorizontalAlignment=3<br />xlsheet.Columns(4).ColumnWidth = 13.63<br />xlsheet.Columns(5).HorizontalAlignment=3<br />xlsheet.Columns(6).HorizontalAlignment=3<br />xlsheet.Columns(6).ColumnWidth = 25<br />xlsheet.Columns(7).HorizontalAlignment=3<br />xlsheet.Columns(7).ColumnWidth = 13.63<br />|</p>
<p>Do While Not (doc Is Nothing)<br />Print |xlsheet.Rows(|+i|).Font.Size=9;|<br />Print |xlsheet.Cells(| +i+|,1).Value='|+"Mid(doc.department(0),1)"+|';|<br />Print |xlsheet.Cells(| +i+|,2).Value='|+"doc.name(0)"+|';|<br />Print |xlsheet.Cells(| +i+|,3).Value='|+"Cstr(doc.OfficeTelExt(0))"+|';|<br />Print |xlsheet.Cells(| +i+|,4).Value='|+"Cstr(doc.Cellphone(0))"+|';|<br />Print |xlsheet.Cells(| +i+|,5).Value='|+"Cstr(doc.CellphoneLittle(0))"+|';|<br />Print |xlsheet.Cells(| +i+|,6).Value='|+"doc.Email(0)"+|';|<br />Print |xlsheet.Cells(| +i+|,7).Value='|+"Cstr(doc.OfficeTel(0))"+|';|<br />i=i+1<br />Set doc=vw.GetNextDocument(doc)<br />Loop<br />Print |<br />xlBook.SaveAs("c:\\通讯录.xls");<br />xlBook.Close ();</p>
<p>xls.Quit();<br />xls=null;<br />alert("已经保存在C盘 通讯录.xls文件中");<br />Temp=window.location.href.toLowerCase();</p>
<p>Temp=Temp.substring(0,Temp.lastIndexOf(".nsf")+5)+"UmSafetyInfo?openview";<br />window.location=Temp;</p>
<p>&lt;/script&gt;<br />|<br />End Sub</p>
<p>&nbsp;</p>
<p>&nbsp;2、常用方法：</p>
<p>&nbsp;Sub Initialize<br />&nbsp;On Error GoTo errormsg&nbsp;&nbsp;<br />&nbsp;Dim session As New NotesSession<br />&nbsp;Dim cdoc As NotesDocument<br />&nbsp;Dim doc As NotesDocument<br />&nbsp;Dim view As NotesView<br />&nbsp;Dim db As NotesDatabase<br />&nbsp;Dim dc As NotesDocumentCollection<br />&nbsp;Set db=session.currentdatabase<br />&nbsp;Set cdoc=session.documentcontext<br />&nbsp;Set view=db.GetView("UmSafetyInfo")&nbsp;<br />&nbsp;<br />&nbsp;tempDir=session.GetEnvironmentString("Directory", True)&nbsp; '<span style="color: red">获取环境变量，将代理权限设低</span><br />&nbsp;If InStr(tempDir, "/") &lt;&gt; 0 And Right(tempDir, 1) &lt;&gt; "/" Then<br />&nbsp;&nbsp; tempDir = tempDir &amp; "/domino/html/"<br />&nbsp;End If&nbsp;<br />&nbsp;If InStr(tempDir, "\") &lt;&gt; 0 And Right(tempDir, 1) &lt;&gt; "\" Then<br />&nbsp;&nbsp; tempDir = tempDir &amp; "\domino\html\"<br />&nbsp;End If<br />&nbsp;&nbsp;&nbsp; filename="中国电信四川公司安全管理人员数据库.xls"&nbsp;<br />&nbsp;filepath=tempDir &amp; filename<br />&nbsp;<br />&nbsp;Print |&lt;script language="javascript"&gt;alert(|+filepath+|)&lt;/script&gt;|<br />&nbsp;If Dir(filePath)&lt;&gt;"" Then Kill filePath<br />&nbsp;Dim excelapplication As Variant <br />&nbsp;Dim excelworkbook As Variant <br />&nbsp;Dim excelsheet As Variant <br />&nbsp;Dim i As Integer <br />&nbsp;Dim uvcols As Integer <br />&nbsp;Dim selection As Variant <br />&nbsp;Set excelapplication=CreateObject("Excel.Application")<br />&nbsp;excelapplication.statusbar="正在创建工作表，请稍等.."<br />&nbsp;excelapplication.Visible=False<br />&nbsp;Set excelWorkbook = excelApplication.Workbooks.Add <br />&nbsp;Set excelSheet = excelWorkbook.Worksheets("sheet1") <br />&nbsp;excelsheet.name="中国电信四川公司安全管理人员数据库" '工作表的名字<br />&nbsp;<br />&nbsp;Dim rows As Integer <br />&nbsp;Dim cols As Integer <br />&nbsp;Dim maxcols As Integer <br />&nbsp;Dim fieldname As String <br />&nbsp;Dim fitem As NotesItem <br />&nbsp;rows=1&nbsp;<br />&nbsp;excelapplication.statusbar="正在创建单元格，请稍等.."&nbsp;&nbsp;<br />&nbsp;excelapplication.Range(excelsheet.Cells(rows, 1), excelsheet.Cells</p>
<p>(rows, 12)).Merge&nbsp;&nbsp; '设置title跨几行显示<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;rows=2<br />&nbsp;excelsheet.Rows(2).Font.Bold=1<br />&nbsp;excelsheet.Rows(2).Font.Name="宋体"<br />&nbsp;excelsheet.Range("A1","L1").MergeCells = 1<br />&nbsp;excelsheet.Cells(1,1).Value="中国电信四川公司安全管理人员数据库"<br />&nbsp;excelsheet.Range("A1","A1").HorizontalAlignment = 3<br />&nbsp;REM&nbsp; 设置风格<br />&nbsp;excelsheet.Rows(1).Font.Bold=1<br />&nbsp;excelsheet.Rows(1).Font.Name="黑体"<br />&nbsp;excelsheet.Rows(1).Font.Size=16<br />&nbsp;excelsheet.Rows(2).Font.Size=9<br />&nbsp;excelsheet.Columns(1).ColumnWidth = 25<br />&nbsp;excelsheet.Columns(2).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(3).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(4).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(4).ColumnWidth = 13.63<br />&nbsp;excelsheet.Columns(5).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(6).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(6).ColumnWidth = 25<br />&nbsp;excelsheet.Columns(7).HorizontalAlignment=3<br />&nbsp;excelsheet.Columns(7).ColumnWidth = 13.63<br />&nbsp;<br />&nbsp;excelsheet.Cells(rows,1).value="单位名称"<br />&nbsp;excelsheet.Cells(rows,2).value="分管领导"<br />&nbsp;excelsheet.Cells(rows,3).value="姓名"<br />&nbsp;excelsheet.Cells(rows,4).value="安办职务"<br />&nbsp;excelsheet.Cells(rows,5).value="性别"<br />&nbsp;excelsheet.Cells(rows,6).value="出生年月"<br />&nbsp;excelsheet.Cells(rows,7).value="学历"<br />&nbsp;excelsheet.Cells(rows,8).value="岗位名称"<br />&nbsp;excelsheet.Cells(rows,9).value="是否兼职"<br />&nbsp;excelsheet.Cells(rows,10).value="兼职名称"<br />&nbsp;excelsheet.Cells(rows,11).value="联系电话"<br />&nbsp;excelsheet.Cells(rows,12).value="手机"<br />&nbsp;<br />&nbsp;cols=12<br />&nbsp;maxcols=cols-1&nbsp;<br />&nbsp;excelapplication.statusbar="正在导出数据，请稍等.."<br />&nbsp;Set doc=view.Getfirstdocument()<br />&nbsp;While Not doc Is Nothing<br />&nbsp;&nbsp;rows=rows+1&nbsp;&nbsp;<br />&nbsp;&nbsp;excelsheet.Cells(rows,1).value=doc.UmDeptName(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,2).value=doc.UmManageLeader(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,3).value=doc.UmUserName(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,4).value=doc.UmWorking(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,5).value=doc.UmSex(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,6).value=doc.UmBirtyday(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,7).value=doc.UmEducation(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,8).value=doc.UmWorkName(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,9).value=doc.UmIsFullTime(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,10).value=doc.UmPartTimeWork(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,11).value=doc.UmTel(0)<br />&nbsp;&nbsp;excelsheet.Cells(rows,12).value=doc.UmMoblie(0)<br />&nbsp;&nbsp;Set doc = view.GetNextDocument(doc)<br />&nbsp;Wend<br />&nbsp;excelapplication.statusbar="数据导入完成。"&nbsp; <br />&nbsp;excelWorkbook.SaveAs(filePath)<br />&nbsp;excelApplication.Quit &nbsp;<br />&nbsp;Set excelapplication=Nothing<br />&nbsp;&nbsp;Print "&lt;script&gt;location.href='/"+ filename&nbsp; +"'&lt;/script&gt;"&nbsp;<br />&nbsp;Exit Sub<br />&nbsp;<br />errormsg:<br />&nbsp;MsgBox "OutExcel Error:" &amp; Str(Erl) &amp; "&nbsp; " &amp; Error&nbsp;<br />End Sub</p>
<p>&nbsp;</p><img src ="http://www.blogjava.net/17learning/aggbug/367933.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/17learning/" target="_blank">guanxianfei</a> 2012-01-05 17:15 <a href="http://www.blogjava.net/17learning/archive/2012/01/05/367933.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>LoutScript 实现群发短信</title><link>http://www.blogjava.net/17learning/archive/2011/12/29/367516.html</link><dc:creator>guanxianfei</dc:creator><author>guanxianfei</author><pubDate>Thu, 29 Dec 2011 09:59:00 GMT</pubDate><guid>http://www.blogjava.net/17learning/archive/2011/12/29/367516.html</guid><wfw:comment>http://www.blogjava.net/17learning/comments/367516.html</wfw:comment><comments>http://www.blogjava.net/17learning/archive/2011/12/29/367516.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/17learning/comments/commentRss/367516.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/17learning/services/trackbacks/367516.html</trackback:ping><description><![CDATA[Sub Initialize<br />&nbsp;<br />&nbsp;On Error Goto errormsg<br />&nbsp;Dim session As New notessession<br />&nbsp;Dim cdoc As notesdocument<br />&nbsp;Dim doc As notesdocument<br />&nbsp;Dim view As notesview<br />&nbsp;Dim db As notesdatabase<br />&nbsp;Dim db_user As NotesDatabase<br />&nbsp;Set db=session.currentdatabase<br />&nbsp;Set cdoc=session.documentcontext<br />&nbsp;Dim mdoc As NotesDocument<br />&nbsp;cdocUnid = cdoc.UniversalID<br />&nbsp;Set db_user = session.GetDatabase(db.Server,"sctel\lyuser.nsf")<br />&nbsp;<br />&nbsp;NotesMacro$ = <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#124;&#64;&#65;&#116;&#116;&#97;&#99;&#104;&#109;&#101;&#110;&#116;&#78;&#97;&#109;&#101;&#115;">|@AttachmentNames</a>|<br />&nbsp;attList = Evaluate(NotesMacro$,cdoc)<br />&nbsp;attNames = ""<br />&nbsp;For i = Lbound(attList) To Ubound(attList)<br />&nbsp;&nbsp;If Trim(attList(i))&lt;&gt; "" Then<br />&nbsp;&nbsp;&nbsp;If attNames = "" Then<br />&nbsp;&nbsp;&nbsp;&nbsp;attNames = attList(i)<br />&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;attNames = attNames + "," + attList(i)<br />&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;End If<br />&nbsp;Next<br />&nbsp;Set view=db.getview("SMS_showFile")<br />&nbsp;For i=0 To Ubound(cdoc.alldeptName)&nbsp;&nbsp;<br />&nbsp;&nbsp;If Len(Trim(cdoc.alldeptName(i)))&gt;0 Then &nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;key=cdocUnid+cdoc.alldeptName(i)<br />&nbsp;&nbsp;&nbsp;Msgbox "key;"+key<br />&nbsp;&nbsp;&nbsp;Set dc=view.getalldocumentsbykey(key,True)<br />&nbsp;&nbsp;&nbsp;Msgbox "dc.count:"+Cstr(dc.count)<br />&nbsp;&nbsp;&nbsp;If dc.count&gt;0 Then <br />&nbsp;&nbsp;&nbsp;&nbsp;Set doc=dc.getfirstdocument<br />&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;Set doc = New NotesDocument(db)<br />&nbsp;&nbsp;&nbsp;&nbsp;Dim authorsItem As New NotesItem(doc, "Author",&nbsp; _<br />&nbsp;&nbsp;&nbsp;&nbsp;"admin", Readers)<br />&nbsp;&nbsp;&nbsp;&nbsp;Dim readersItem As New NotesItem(doc, "yhuser",&nbsp; _<br />&nbsp;&nbsp;&nbsp;&nbsp;Trim(cdoc.alldeptName(i)), Authors)<br />&nbsp;&nbsp;&nbsp;End If&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;doc.HYUNID=cdocUnid<br />&nbsp;&nbsp;&nbsp;doc.SMS_Subject=cdoc.SMS_Subject(0)<br />&nbsp;&nbsp;&nbsp;'根据人员取出部门，部门编号<br />&nbsp;&nbsp;&nbsp;Set view_user = db_user.GetView("viewShowfileByUserName")<br />&nbsp;&nbsp;&nbsp;Set doc_user = view_user.GetDocumentByKey(cdoc.alldeptName(i),True)<br />&nbsp;&nbsp;&nbsp;If Not doc_user Is Nothing Then<br />&nbsp;&nbsp;&nbsp;&nbsp;doc.TypeNum = doc_user.TypeNum(0)<br />&nbsp;&nbsp;&nbsp;&nbsp;Set view_dept = db_user.GetView("viewDeptByNum")<br />&nbsp;&nbsp;&nbsp;&nbsp;Set doc_dept = view_dept.getdocumentbykey(doc_user.TypeNum(0),True)<br />&nbsp;&nbsp;&nbsp;&nbsp;If Not doc_dept Is Nothing Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doc.TypeName = doc_dept.Type(0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doc.deptNa = doc_dept.Type(0)<br />&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;Call doc.save(True,True)'存储&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;Dim SendTo(1) As String&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;SendTo(0) = cdoc.alldeptName(i)<br />&nbsp;&nbsp;&nbsp;Call sendMessge(SendTo)<br />&nbsp;&nbsp;End If &nbsp;&nbsp;<br />&nbsp;Next<br />&nbsp;cdoc.htmls="消息已经发送！"<br />&nbsp;'doc.SMS_riqi=Evaluate("@Created")&nbsp; '重新创建时间<br />&nbsp;Call cdoc.save(True,True)'存储&nbsp;<br />&nbsp;cdoc.htmls="&lt;script&gt;alert('发送成功！');&lt;/script&gt;"&nbsp;<br />&nbsp;Exit Sub<br />errormsg:<br />&nbsp;Msgbox "save Error:" &amp; Str(Erl) &amp; "&nbsp; " &amp; Error<br />&nbsp;<br />End Sub<br /><br /><br />Sub sendMessge(SendTo As Variant)<br />&nbsp;On Error&nbsp; Goto processError&nbsp;<br />&nbsp;Dim session As New notessession<br />&nbsp;Set db=session.currentdatabase<br />&nbsp;Set cdoc=session.documentcontext<br />&nbsp;Dim doc As NotesDocument<br />&nbsp;Dim view As NotesView<br />&nbsp;Dim UserDB As NotesDatabase<br />&nbsp;Dim tel As String<br />&nbsp;Dim content As String<br />&nbsp;query = cdoc.Query_String_Decoded(0)<br />&nbsp;Dim smsitem As NotesItem<br />&nbsp;Set smsitem =cdoc.GetFirstItem("SMS_Body")&nbsp;<br />&nbsp;content="您好！请即时处理委机关办公系统中的《"+cdoc.foldername(0)+":"+smsitem.Text+"》文件，谢谢！["+cdoc.PUser(0)+"]"<br />&nbsp;'Msgbox"短信内容:"+content<br />&nbsp;Dim i,j As Integer<br />&nbsp;i = 0<br />&nbsp;Set UserDB = session.GetDatabase("","sctel/lyuser.nsf")<br />&nbsp;Set view = UserDB.GetView( "cellPhoneByUser" )<br />&nbsp;content=Replace(content,"&gt;","＞")<br />&nbsp;content=Replace(content,"&lt;","＜")<br />&nbsp;Forall p In SendTo<br />&nbsp;&nbsp;If p &lt;&gt; "" Then<br />&nbsp;&nbsp;&nbsp;'获取处理人号码<br />&nbsp;&nbsp;&nbsp;Set doc = view.GetDocumentByKey (p)<br />&nbsp;&nbsp;&nbsp;If Not (doc Is Nothing) Then<br />&nbsp;&nbsp;&nbsp;&nbsp;tel=doc.CellPhoneNumber(0)<br />&nbsp;&nbsp;&nbsp;&nbsp;'Msgbox "tel---&gt;"+tel<br />&nbsp;&nbsp;&nbsp;&nbsp;If tel &lt;&gt; "" Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Msgbox "开始测试短信"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim xmlhttp As Variant<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim data,&nbsp;URL&nbsp; As String<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set xmlhttp = CreateObject("Microsoft.XMLHTTP")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = |&lt;?xml version="1.0" encoding="utf-8"?&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data + |&lt;soap:Envelope xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>" xmlns:soap="<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>"&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data + |&lt;soap:Body&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data+|&lt;sendMessageToNextPerson xmlns="<a href="http://www.chinatelecom.com.cn/schema/ctcc/common/v2_1">http://www.chinatelecom.com.cn/schema/ctcc/common/v2_1</a>"&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data +|&lt;senderaddr&gt;|+Trim(tel)+|&lt;/senderaddr&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data + |&lt;content&gt;|+content+|&lt;/content&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data + |&lt;/sendMessageToNextPerson&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data + |&lt;/soap:Body&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data = data +|&lt;/soap:Envelope&gt;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL="<a href="http://localhost:82/sendSMS/gzwSendSM.asmx?op=sendMessageToNextPerson">http://localhost:82/sendSMS/gzwSendSM.asmx?op=sendMessageToNextPerson</a>"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.Open "POST",url, False<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.SetRequestHeader "Content-Type", "text/xml; charset=utf-8" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.SetRequestHeader "Content-Length", "length"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.SetRequestHeader "SOAPAction","<a href="http://221.236.6.218:5080/isag/North/SMS/SendSms">http://Ip:5080/isag/North/SMS/SendSms</a>"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.Send(data)<br />&nbsp;&nbsp;&nbsp;&nbsp;Else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Msgbox "未找到号码"<br />&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;Messagebox "未找到号码"<br />&nbsp;&nbsp;&nbsp;End If&nbsp;<br />&nbsp;&nbsp;End If<br />&nbsp;End Forall<br />&nbsp;<br />&nbsp;Exit Sub<br />&nbsp;<br />processError:<br />&nbsp;Dim sTemp As String<br />&nbsp;sTemp = "ini出错行:" + Cstr(Erl()) + " 出错信息:" + Error() +&nbsp; " 请与管理员联系!"<br />&nbsp;Print |&lt;script&gt;alert("|+sTemp+|")&lt;/script&gt;|<br />&nbsp;<br />&nbsp;Exit Sub<br />&nbsp;<br />End Sub<img src ="http://www.blogjava.net/17learning/aggbug/367516.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/17learning/" target="_blank">guanxianfei</a> 2011-12-29 17:59 <a href="http://www.blogjava.net/17learning/archive/2011/12/29/367516.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>LotusScript 代理的基本用法</title><link>http://www.blogjava.net/17learning/archive/2011/12/26/367148.html</link><dc:creator>guanxianfei</dc:creator><author>guanxianfei</author><pubDate>Sun, 25 Dec 2011 16:46:00 GMT</pubDate><guid>http://www.blogjava.net/17learning/archive/2011/12/26/367148.html</guid><wfw:comment>http://www.blogjava.net/17learning/comments/367148.html</wfw:comment><comments>http://www.blogjava.net/17learning/archive/2011/12/26/367148.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/17learning/comments/commentRss/367148.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/17learning/services/trackbacks/367148.html</trackback:ping><description><![CDATA[<p><strong>1、FTSearch搜索：</strong><br />&nbsp;&nbsp; &nbsp;Set dc=db.Ftsearch("name",0)&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '0位置为最大的查询数，0为所有匹配的文件&nbsp; FTSearch必须创建数据库索引<br />&nbsp;Set doc=dc.Getfirstdocument()、<br /><strong>2、Item：</strong><br />&nbsp; &nbsp;Set doc=dc.Getfirstdocument()<br />&nbsp;While Not doc&nbsp; Is Nothing<br />&nbsp;&nbsp; ForAll ritem In doc.Items<br />&nbsp;&nbsp; &nbsp;&nbsp; MsgBox ritem.name<br />&nbsp;&nbsp; End ForAll<br />&nbsp;Wend<br /><strong>3、取出特定的域</strong><br />&nbsp;Set doc=view.getFirstdocument()<br />&nbsp;If doc.HashItem("yu") &lt;&gt; "" Then<br />&nbsp;&nbsp;&nbsp; Set item=doc.getfirstitem("yu")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set doc=view.getNextdocument(doc)<br />&nbsp;End If<br /><strong>4、使用文本属性</strong><br />If doc.Hashitem("yu") &lt;&gt; ""&nbsp; Then<br />&nbsp;Set doc=dc.Getfirstdocument()<br />&nbsp;&nbsp;While Not doc Is&nbsp; Nothing<br />&nbsp;&nbsp;&nbsp; ForAll itemValue In doc.yu<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; itemValue = "Anonymous"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End ForAll&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set doc=dc.Getnextdocument(doc)<br />&nbsp;&nbsp;Wend<br />End If<br /><strong>5、获取域值：</strong><br />&nbsp;&nbsp; ForAll itemValue In doc.Getitemvalue("yu")<br /><strong>6、添加域</strong><br />&nbsp; set item =new NotesItem(doc,"newYu",session.UserName) <br />&nbsp; Call doc.Appenditemvalue("newYu",Newvalue)<br /><strong>7、替换值：</strong><br />&nbsp; 1)、 While Not doc Is Nothing <br />&nbsp;&nbsp;Call doc.Replaceitemvalue("resName","newValue")<br />&nbsp;&nbsp;Set doc=dc.getnextdocument(doc)<br />&nbsp;Wend</p>
<p>&nbsp;&nbsp; 2)、Set doc=dc.Getfirstdocument()<br />&nbsp;While Not doc Is Nothing <br />&nbsp;&nbsp;'Call doc.Replaceitemvalue("resName","newValue")<br />&nbsp;&nbsp;Set item =doc.Getfirstitem("yu")<br />&nbsp;&nbsp;While Not item Is Nothing<br />&nbsp;&nbsp;&nbsp;&nbsp; ForAll resitems In doc.Itemsv(0)<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; resitems="newVlaue"<br />&nbsp;&nbsp;&nbsp;&nbsp; End ForAll<br />&nbsp;&nbsp;&nbsp;&nbsp; doc.name= doc.Itemsv(0)<br />&nbsp;&nbsp;&nbsp;&nbsp; Set item =doc.getnextitem(item)<br />&nbsp;&nbsp;Wend<br />&nbsp;&nbsp;Set doc=dc.getnextdocument(doc)<br />&nbsp;Wend<br /><strong>8、拷贝域</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set item =doc.Getitemvalue("name")<br />&nbsp; call item.Copyitemtodocument(doc, "name")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call doc.save(true,false)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call doc1.Copyallitems(doc2,true)&nbsp; &#8216;替换所有的<br /><strong>9、删除指定的域：</strong><br />&nbsp;&nbsp;&nbsp;&nbsp; 1)、 For j=1 To dc.count<br />&nbsp;&nbsp;&nbsp;Set item=doc.Getitemvalue("name")<br />&nbsp;&nbsp;&nbsp;While Not item Is&nbsp; Nothing<br />&nbsp;&nbsp;&nbsp;&nbsp;Call item.Remove()<br />&nbsp;&nbsp;&nbsp;&nbsp;Call doc.Save(true,false)<br />&nbsp;&nbsp;&nbsp;Wend<br />&nbsp;&nbsp;Set doc=dc.Getnthdocument(j)<br />&nbsp;&nbsp;&nbsp;&nbsp; Next<br />&nbsp;&nbsp;&nbsp;&nbsp; 2)、For j=1 To dc.count&nbsp;&nbsp;<br />&nbsp; While Not doc.Hasitem("name")<br />&nbsp;&nbsp;&nbsp; Call doc.Removeitem("name")<br />&nbsp;&nbsp;&nbsp; Call doc.Save(True,false)<br />&nbsp; Wend&nbsp; <br />&nbsp;&nbsp; Set doc=dc.Getnthdocument(j)&nbsp;&nbsp;&nbsp; <br />&nbsp;Next<br /><strong>10、RTF文本域的输出：</strong><br />&nbsp;Set item=doc.GetFirstItem("RtfYU")<br />&nbsp;MsgBox item.Text<br /><strong>11、在代理中使用公式：</strong></p><div><div>&nbsp; &nbsp; &nbsp;temp=Evaluate("@ReplaceSubstring(aa;bb;cc)",doc)</div></div><strong>12、 嵌入对象：</strong><br />&nbsp;ForAll csx In doc.Embeddedobjects<br />&nbsp;&nbsp;&nbsp; csx.name<br />&nbsp;End ForAll<br />&nbsp;&nbsp; &nbsp;Set doc=dc.Getnthdocument(j)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next<br /><strong>13、激活嵌入对象：</strong><br />&nbsp;&nbsp;&nbsp; Call doc.EmbeddedObjects(0).Activate(True)<br /><strong>14、if的用法</strong><br />&nbsp;&nbsp;&nbsp; Set doc=dc.Getfirstdocument()<br />&nbsp;&nbsp;&nbsp; If Not IsEmpty(db.Agents) Then<br />&nbsp;&nbsp;&nbsp; ForAll agent In db.Agents<br />&nbsp;&nbsp;&nbsp; &nbsp;MsgBox agent.name<br />&nbsp;&nbsp;&nbsp; End ForAll<br />&nbsp;&nbsp;&nbsp;&nbsp; End If<br /><br /><p>&nbsp;</p><img src ="http://www.blogjava.net/17learning/aggbug/367148.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/17learning/" target="_blank">guanxianfei</a> 2011-12-26 00:46 <a href="http://www.blogjava.net/17learning/archive/2011/12/26/367148.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>