Lotus中定制搜索

Sub SearchWeb()
 Dim QryDB As NotesDatabase
 Dim vwDBList As NotesView
 Dim sQueryString As String
 Dim sMinRecord,sMaxRecord,sSortMethod,sTemp,sQry,sOldQry,sSymbol As String
 Dim sSearchFuzzy As String
 Dim sUseCache As String
 Dim sServername As String
 Dim sDbName As String
 Dim sViewName As String
 Dim sPage As String
 Dim sCondition As String
 Dim sDBDocID As String
 Dim sFields As String
 Dim vResult() As Variant
 Dim vTemp,vDBDocList As Variant
 Dim i,j,iRecordNumber As Integer
 
 Set session = New NotesSession
 Set db = session.currentdatabase
 Set doc = session.documentcontext
 sQry = doc.Query_String_Decoded(0)
 sOldQry = sQry
 '-------------------------------- 获取查询参数 --------------------------------------
 vTemp = Evaluate("@ReplaceSubstring('"+sQry+"';'+';' ')")
 
 sTemp = vTemp(0)
 sQry = sTemp
 
 i = Instr(sTemp,"^")
 sCondition = Mid(sTemp,i+1) '查询条件
 
 sDBDocID = Left(sTemp,i-1)
 i = Instr(sDBDocID,"&")
 sDBDocID = Mid(sDBDocID,i+1)'查询视图参数
 
 'sSortMethod = Mid(sCondition,Instr(sCondition,"~")+1,1)'排序方式 
 sSearchFuzzy = Mid(sCondition,Instr(sCondition,"!")+1,1)'是否使用模糊查询
 sUseCache = Mid(sCondition,Instr(sCondition,"$")+1,1)'是否使用Cache
 
 i = Instr(sCondition,"@")
 j = Instr(i+1,sCondition,"@")
 sMinRecord=Val(Mid(sCondition,i+1,j-i-1))'查询记录起始数
 sMaxRecord=Val(Mid(sCondition,j+1))'查询记录每页最大结果数
 sCondition = Mid(sCondition,1,i-1)'取得查询关键字 
 
 vDBDocList = Extract(sDBDocID,",") '获取查询视图参数的数组
 
 Call ExtractArray(sCondition) '获取查询关键字列表
 iRecordNumber = 0
 sPage = ""
 sSymbol = ""
 If sSearchFuzzy = "1" Then
  sSymbol = "*"
 End If
 '------------------------------------------------------------------------------------
 '---------------------------------- 开始查询 ----------------------------------------
 Forall x In vDBDocList
  vTemp = Extract(Cstr(x),"!")'拆分查询参数(所在服务器!所在数据库!查询视图)
  
  sServerName=vTemp(0)'查询数据库所在服务器
  sDbName=vTemp(1)'查询数据库
  sViewName = vTemp(2)'查询的视图名
  
  Set QryDB = New NotesDatabase(sServerName,sDbName)'取得查询数据库对象
  
  Set view = QryDB.getview(sViewName)'取得查询数据库视图
  sQry=""
  sQueryString = ""
  Forall y In sQryKey
   sQry = Replace(y,"""","''")
   sTemp = ""
   '当指定域查询时
   If doc.Fields(0) <> "" Then
    Forall z In doc.Fields
     If sTemp = "" Then
      sTemp = "FIELD "+z+{ contains "}+sSymbol+sQry+sSymbol+{"}
     Else
      sTemp = sTemp + " AND FIELD "+z+{ contains "}+sSymbol+sQry+sSymbol+{"}
     End If
    End Forall
    
    If sQueryString = "" Then
     sQueryString = "(" + sTemp +")"
    Else
     sQueryString = sQueryString + " OR (" + sTemp +")"
    End If
   Else'未指定域
    If sQueryString = "" Then
     sQueryString = sQry
    Else
     sQueryString = sQueryString + " AND " + sQry
    End If
   End If
  End Forall
  j = view.FTSearch( sQueryString, Cint(sMaxRecord))'开始查询
  '将结果形成XML数据
  If j>0 Then
   For i = 1 To j
    iRecordNumber = iRecordNumber + 1
    Set qrydoc = view.getnthdocument(i)
    sPage = sPage + {<row url="javascript:opendoc('/}+QryDB.Replicaid+{/0/}+qrydoc.Universalid+{?opendocument')">}
    sPage = sPage + {<number>}+Cstr(iRecordNumber)+{</number>}
    sPage = sPage + {<title>}+qrydoc.ColumnValues(0)+{</title>}
    sPage = sPage + {<category>}+doc.Name(0)+{</category>}
    sPage = sPage + {<score>}+Cstr(qrydoc.FTSearchScore)+{%</score>}
    sPage = sPage + {</row>}
   Next
  End If
  Call view.clear
 End Forall
 '------------------------------------------------------------------------------------
 '---------------------------------- 输出结果 ----------------------------------------
 Print {Content-type: text/xml}
 Print {<?xml version='1.0' encoding="utf-8" ?>}
 Print {<view name="查询结果" id="vgosearchresult.xml">}
 Print {<header>}
 Print { <number>序号</number>}
 Print { <title>标题</title>}
 Print { <category>位置</category>}
 Print { <score>匹配度</score>}
 Print {</header>}
 Print {<action/>}
 Print {<rows>}
 Print sPage
 Print {</rows>}
 Print {</view>}
 '------------------------------------------------------------------------------------
End Sub

posted @ 2010-04-09 09:21 明高 阅读(138) | 评论 (0)编辑 收藏

在Lotus开发中的使用JDBC进行数据交互

import java.io.*;
import java.net.URL;
import java.sql.*;
import java.util.Properties;
import lotus.notes.*;
import java.util.*;

public class  savetonewdatabase extends AgentBase {
 public void NotesMain() {

  Driver drv = null;
  PrintWriter out = null; 
       try {
           Session session = getSession();
           AgentContext ac = session.getAgentContext();
           Database db = ac.getCurrentDatabase();
   Database SendDB = session.getDatabase(db.getServer(),"lt_getfile.nsf");
           Document doc = ac.getDocumentContext();   

           out = getAgentOutput();      
               String docUnid;
               //Get the new record's unid
               docUnid = uniqueID();
                   
   //Get the sql insert statement   
   StringBuffer SqlUrl = new StringBuffer("Insert into Shouwen_stat (");
   StringBuffer SqlValue = new StringBuffer(" values (");

     String temp= doc.getItemValueString("F_hao");
  
               if(temp!=null){
                temp = doc.getItemValueString("F_ziTitle")+"〔"+doc.getItemValueString("F_zi")+"〕"+doc.getItemValueString("F_hao")+"号";
                }else{
                temp = "〔"+doc.getItemValueString("F_zi")+"〕";
               }  
 
   if (temp!= null){
    SqlUrl.append("doc_no");
    SqlValue.append("'" + temp+"'");
     
   }
   String doc_id = doc.getItemValueString("CurDocId");
   if (doc_id != null) {
    SqlUrl.append(",doc_id");
    SqlValue.append(",'" + doc_id + "'");
   }
   String sqlField = doc.getItemValueString("F_title");
   if (sqlField != null) {
    SqlUrl.append(",doc_title");
    SqlValue.append(",'" + sqlField + "'");
    }
   
   sqlField = doc.getItemValueString("shenghr");
   if (sqlField != null) {
    SqlUrl.append(",niban_people");
    SqlValue.append(",'" + sqlField + "'");
   }
   
   sqlField = doc.getItemValueString("F_BigSpecies");
   if (sqlField != null) {
    SqlUrl.append(",wen_zhong");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("text");
   if (sqlField != null) {
    SqlUrl.append(",file_content");
    SqlValue.append(",'" + sqlField  + "'");
   }

   sqlField = doc.getItemValueString("timewrite"); //收文日期
   
   if (sqlField != null) {
    SqlUrl.append(",shouwen_date");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("F_FilekeyWord");
   if (sqlField != null) {
    SqlUrl.append(",title_word");
    SqlValue.append(",'" + sqlField  + "'");
    }
   sqlField = doc.getItemValueString("F_emergency");
   if (sqlField != null) {
    SqlUrl.append(",huan_ji");
    SqlValue.append(",'" + sqlField + "'");
   }
   
   sqlField = doc.getItemValueString("F_UnitName");
   if (sqlField != null) {
    SqlUrl.append(",laiwen_unit");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("F_Secret");
   if (sqlField != null) {
    SqlUrl.append(",mi_ji");
    SqlValue.append(",'" + sqlField  + "'");
    }

   sqlField = doc.getItemValueString("laiwfs");
   if (sqlField != null) {
    SqlUrl.append(",laiwen_mode");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("shengpyj");
   if (sqlField != null) {
    SqlUrl.append(",niban_date");
    SqlValue.append(",'" + sqlField  + "'");
   }
   
   sqlField = doc.getItemValueString("shenghyj");
   if (sqlField != null) {
    SqlUrl.append(",niban_yijian");
    SqlValue.append(",'" + sqlField + "'");
   }
   
   sqlField = doc.getItemValueString("F_EndTime");
   if (sqlField != null) {
    SqlUrl.append(",banli_qixian");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("lind");
   
   if (sqlField != null) {
    SqlUrl.append(",chengban_yj");
    SqlValue.append(",'" + sqlField  + "'");
    }

   sqlField = doc.getItemValueString("pisyj");
   if (sqlField != null) {
    SqlUrl.append(",piban_date");
    SqlValue.append(",'" + sqlField  + "'");
   }
   
   sqlField = doc.getItemValueString("lindps");
   if (sqlField != null) {
    SqlUrl.append(",piban_yijian");
    SqlValue.append(",'" + sqlField  + "'");       
   }

       sqlField = doc.getItemValueString("banlyj");
   if (sqlField != null) {
    SqlUrl.append(",banli_jieguo");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("banlr");
   if (sqlField != null) {
    SqlUrl.append(",banli_people");
    SqlValue.append(",'" + sqlField  + "'");
   }

   sqlField = doc.getItemValueString("banlsj");
   if (sqlField != null) {
    SqlUrl.append(",banli_date");
    SqlValue.append(",'" + sqlField  + "'");
   }
               sqlField = doc.getItemValueString("chengbyj");
   if (sqlField != null) {
    SqlUrl.append(",piban_people");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("chengbr");
   if (sqlField != null) {
    SqlUrl.append(",chengban_people");
    SqlValue.append(",'" + sqlField  + "'");
   }

   sqlField = doc.getItemValueString("chengbsj");
   if (sqlField != null) {
    SqlUrl.append(",chengban_date");
    SqlValue.append(",'" + sqlField  + "'");
   }
   sqlField = doc.getItemValueString("temp");  //流水号
   if (sqlField != null) {
    SqlUrl.append(",shouwen_bianhao");
    SqlValue.append(",'" + sqlField  + "'");
   }  
   sqlField=doc.getItemValueString("shihgd");   //文件是否归档
  if(sqlField!=null){
   SqlUrl.append(",document_state");
    SqlValue.append(",'"+sqlField+"'");
   } 
   sqlField=doc.getItemValueString("wenjzx");    //文件走向
   if(sqlField!=null){
    SqlUrl.append(",send_file");
    SqlValue.append(",'"+sqlField+"'");
   }   

   SqlUrl.append(")");
   SqlValue.append(")");
   String Va = SqlValue.toString();
    SqlUrl.append(Va);
   
   // Connect to data source
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   drv = new sun.jdbc.odbc.JdbcOdbcDriver();   
   
   String url = "jdbc:odbc:is_archive";
                 
   Properties props = new Properties();
   props.put("user","isa");
   props.put("password","gxmi");   
   Connection con = drv.connect(url,props);
   
   if (con==null){
    out.println("<h1>Con't Connect to DB!</h1>");
    return;
   }   
   Statement stmt = con.createStatement();
   
   //Insert a record to the Fwdj table             
   Va = SqlUrl.toString();
   Va =new String(Va.getBytes("gb2312"),"ISO-8859-1"); 
   
   stmt.executeUpdate(Va);
 
  
         out.println("<link rel='stylesheet' href='/oa.css'><br><br><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>");
             out.println("<TR VALIGN=top><TD WIDTH=232><IMG SRC='/Lt_getfile.nsf/c01a1dee4878d8a648256b270024a88c/$Body/0.25E!OpenElement&FieldElemFormat=gif' WIDTH=208 HEIGHT=21></TD>");
             out.println("<TD WIDTH=416 VALIGN=middle><DIV ALIGN=center><B><FONT SIZE=5 COLOR='0000FF'>操作反馈信息</FONT></B></DIV></TD></TR></TABLE>");
             out.println("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR VALIGN=top>");
             out.println("<TD WIDTH=689><IMG SRC='/Lt_getfile.nsf/c01a1dee4878d8a648256b270024a88c/$Body/0.CFA!OpenElement&FieldElemFormat=jpg' WIDTH=688 HEIGHT=4></TD></TR>");
             out.println("</TABLE><BR><br><br><br><br><P><BR><BR><BR><BR>");
             out.println("<table border=0  bgColor=#0099cc borderColorLight=#000000 cellPadding=1 cellSpacing=2 align='center'><tr><td  bgcolor=#EFEFEF>文件发送给下一办理人"+doc.getItemValue("sendtobak")+"办理!</td></tr></table>");
 
  } catch (Exception e) {
   out.println(e.getMessage());
   e.printStackTrace();
  }
    }
 public static String uniqueID()
  {
         StringBuffer sb=new StringBuffer(20);
     java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat("yyyy/MM/dd");
     java.util.Date currentTime=new java.util.Date();
     String sid=formatter.format(currentTime);
     return sid;
     }
    
 public static String replaceAll(String operStr,String oldStr ,String replaceStr){
  int fromIndex=0;
  int index=0;
  int oldStrLen=oldStr.length();
  int replaceStrLen=replaceStr.length();
  
  while((index=operStr.indexOf(oldStr,fromIndex))!=-1){
   //新的位置起点
   //fromIndex+replaceStrLen-oldStrLen+1
   fromIndex=index + replaceStrLen;
   operStr=operStr.substring(0,index)+replaceStr+
    operStr.substring(index+oldStrLen,operStr.length());
  }
  
  return operStr;
 }
 
 
 
}

posted @ 2010-04-09 09:20 明高 阅读(398) | 评论 (0)编辑 收藏

lotus notes 开发中BS下实现组合查询的方法

在进行系统设计的时候用户要求对各文件能够实现组合条件的查询和统计,开发之初我选择了notes自身提供的综合查询表单$$Search Form来实现,但在用户使用了一段时间发现,采用$$Search Form来进行组合条件查询时常常会搜索到许多并不满足条件的文档或者搜索到的文档根本就不知道是什么,为了解决这个问题,我决定写代码来实现组合条件查询,下面就来讲讲实现的过程。   首先建立一个表单(Fsearch),主要用来现实和选择查询条件,表单的域元素如下表所示:

编号
 域名
 含义
 类型
 说明
 
01
 SaveOptions
 防止使用该表单创建文档
 文本域
 该域是系统域当值为”0”的时候当前表单不会创建文档,因为这里使用该表单仅仅是为了选择查询条件,不需要创建文档,所以该域的值为“0”
 
02
 biaoti
 发文标题
 文本域
  
03
 zhutici
 主题词
 文本域
  
04
 laiwenhao
 发文号
 文本域
  
05
 nigaoren
 拟稿人
 文本域
  
06
 danwei
 拟稿人单位
 文本域
  
07
 syear
 文档所属年度
 文本域
  
08
 smonth
 文档所属月份
 文本域
  

在表单上按照用户要求和使用习惯利用表格布局好上述元素后,在表单上创建一个热点按钮“现在查找“,执行@Command([ToolsRunMacro];"(wFaWenSearch)") 的公式命令,其中wFaWenSearch 是一个共享代理,代码如下:Sub Initialize    ‘//定义变量 Dim session As New NotesSession Dim cDoc As NotesDocument Dim db As NotesDatabase Dim sResult , Set sResultemp  As NotesDocumentCollection Dim sql As String   Set db=session.currentDatabase  ‘//获得当前数据库 Set cDoc=session.DocumentContext() ‘//获得当前文档,即用户打开的选择条件的表单Fsearch Set view=db.getView("($UNID)") ‘//获得($UNID)视图,该视图里现实所有文件 ‘//============获取查询条件=========// sYear=cDoc.syear(0) sMonth=cDoc.smonth(0) biaoti=cDoc.biaoti(0) zhutici=cDoc.zhutici(0)  laiwenhao=cDoc.laiwenhao(0) danwei=cDoc.danwei(0) nigaoren=cDoc.nigaoren(0)  ‘//================END================//‘//=====组合查询条件======//sql="form=""fwmain"""+"&(@Contains(biaoti;"""+biaoti+""")"+"|@Contains(zhutici;"""+zhutici''>|@Contains(zhutici;"""+zhutici+""")"+_"|@Contains(t1+""[""+@text(t2)+""]""+@text(t3''>|@Contains(t1+""[""+@text(t2)+""]""+@text(t3)+ ""号""+;"""+laiwenhao+""")"+"|@contains(danwei">|@contains(danwei; """+danwei+""")"+_"|@Contains(nigaoren;"""+nigaoren+""")"+"|@Contains(sYear;"""+sYear''>|@Contains(nigaoren;"""+nigaoren+""")"+"|@Contains(sYear;"""+sYear+""")"+"| @Contains(sMonth;"""+sMonth+"""))"Set  sResultemp= db.search(sql,Nothing,0)  ‘//在数据库中搜索满足上述条件的所有文档,获得该文档集;但是由于使用search语法会把当前操’//作者没有阅读权限的文档也搜索到,所以先把搜索到的文档集赋予临时变量sResultemp 再进行处理 Set  sResult=db.search("@Contains(sYear;''1'')",Nothing,0) ‘//初始化一个文档集sResul,这文档集中没有文件的‘//========下面这循环主要是利用视图对文档读者权限的限制功能把sResultemp====//‘//========这个文档集中当前用户有阅读权限的文档添加到文档集sResul中去=====// For i=1 To  sResultemp.count  Set  sDoc=sResultemp.getNthDocument(i)  key=sDoc.bh(0)  Set  Sview=db.getView("default")  Set  sDoc=Sview.Getdocumentbykey(key,True)  If  Not  sDoc  Is  Nothing Then   Set  sDoctmp=sResult.Getdocument(sDoc)   If  sDoctmp Is  Nothing Then    Call sResult.Adddocument(sDoc)   End If  End If Next If  sResult.count=0  Then  Print "没有找到您要查找的文件"  Exit Sub End  If  ''//=========创建网页来显示查询结果=======// Print "<html>" Print "<head>" Print "<link rel=stylesheet type=text/css href=ViewCss.css>" Print "</script>" Print "</head>"Print "<body>" Print "<table width=100%>" Print "<tr>" Print "<td colspan=6 align=right style=border-style:solid;border-width:0 0 2px;border-color:#669933>查找到&nbsp;"+Cstr(jjj)+"&nbsp;份文件&nbsp;<br>" Print "</td>" Print "</tr>" Print "<tr>" Print "<td width=5% class=td1></td>" Print "<td width=10% class=td1>年度</td>" Print "<td width=10% class=td1>月份</td>" Print "<td width=40% class=td1>标题</td>" Print "<td width=20% class=td1>主办部门</td>" Print "<td width=15% class=td1>拟稿人</td>" Print "</tr>" For i=1 To sResult.count  Set sDoc=sResult.getNthDocument(i)  Set sDoc=view.getDocumentByKey(sDoc.bh(0),True)  If Not sDoc Is Nothing Then      Print "<tr>"    Print "<td class=tdx><a href=/"+sDoc.DBPath(0)+"/merit_gwgl.nsf/($UNID)/"+sDoc.UniversalID+"?opendocument target=_blank><img src=01.gif border=0 ></a></td>"   Print "<td class=tdx>"+sDoc.sYear(0)+"</td>"   Print "<td class=tdx>"+sDoc.sMonth(0)+"</td>"   Print "<td class=tdx>"+sDoc.biaoti(0)+"</td>"   Print "<td class=tdx>"+sDoc.danwei(0)+"</td>"   Print "<td class=tdx>"+sDoc.nigaoren(0)+"</td>"   Print "</tr>"  End If Next Print "</table>"  Print "</body>" Print "</html>" End Sub

posted @ 2010-04-09 09:20 明高 阅读(394) | 评论 (0)编辑 收藏

Js操控Lotus中的附件

<input type="checkbox" name="%%Detach" value="IBM咨询.txt"><a href="附件路径">IBM咨询.txt</a></td></tr>

选中以后,保存文档,附件就会被系统自动删除 
江川之子 22:04:47 使用什么方法定位嵌入的embeddedobject呢 ,嵌入到文档还是rtf域 
CoolStar~_~ 22:04:55 文档 
江川之子 22:05:24 只能用getembedobject 
江川之子 22:05:44 如果是rtf中的就可以用ref。emdedobjects  

 主业务数据表组,日志数据表组,组织结构权限组表,辅助数据表组,业务控制数据表组,
尤其对于oa,组织结构最重要。对于一般的业务,业务控制数据最重要,这样可以让你的业务变的很灵活。

posted @ 2010-04-09 09:19 明高 阅读(153) | 评论 (0)编辑 收藏

LotusScript操纵附件

Sub InitAttachment
 On Error Goto ErrorHandle
 Dim temDoc    As notesDocument
 Dim temDoc1  As NotesDocument
 Dim docAttachment As NotesDocument
 Dim strQuery   As String
 Dim strUNID   As String
 Dim strFormula  As String
 Dim strList  As String
 Dim vPath   As Variant
 strQuery = note.Query_String_Decoded(0)
 If Instr(strQuery,"&UNID=") > 0 Then
  strUNID = Mid(strQuery,Cint(Instr(strQuery,"&UNID=")) + 6,32)
  Set temDoc = db.GetDocumentByUNID(strUNID)
  If Not (temDoc Is Nothing) Then
   Set docAttachment = db.CreateDocument
   docAttachment.Form = "fmAttachment"
   docAttachment.Status = "0"
   docAttachment.CourseInfoUnid = temDoc.UniversalID
   If temDoc.HasEmbedded Then   
    Set temDoc1 = db.CreateDocument
    Call temDoc.CopyAllItems (temDoc1)
    Forall item In temDoc1.Items
     If Not (Ucase(item.Name) = "$FILE") Then
      temDoc1.RemoveItem (item.Name)
     End If
    End Forall
    Call temDoc1.CopyAllItems(docAttachment)
   End If   
  End If  
 End If
 Call docAttachment.Save(True,False)
 docAttachment.CurUnid = docAttachment.UniversalID
 Call docAttachment.Save(True,False)
 vPath = Evaluate(|@ReplaceSubstring(@Subset(@DbName;-1); " " : "\\"; "+" : "/")|)
 Print |<script language="javascript">  |
 Print |<!--       |
 Print |window.location.href = "/| & vPath(0) & _
 |/0/| & docAttachment.UniversalID & |?editdocument";|
 Print |-->    |
 Print |</script>   | 
 Exit Sub
'Domino Control Platform Error Info  
ErrorHandle:
 Messagebox db.FilePath & "_LibEduCommand.InitAttachment:" & Error$ & " at line number " & Cstr(Erl)
 'Resume Next 
End Sub

posted @ 2010-04-08 19:50 明高 阅读(420) | 评论 (0)编辑 收藏

使用MIME发送邮件通知

Sub SendMailNotification( docMain As Notesdocument, strSendto As String ,strTempletNum As String)
 On Error Goto ErrorHandle
 
 Dim docMail   As NotesDocument
 Dim rti    As NotesRichTextItem
 Dim body    As NotesMIMEEntity
 Dim child   As NotesMIMEEntity
 Dim stream   As NotesStream
 Dim strTmp   As String
 Dim strReplace  As String
 Dim bSuccess  As Boolean
 Dim strHtml  As String
 s.ConvertMIME   = False
 Set stream   = s.CreateStream
 
 Set docMail  = New NotesDocument(docMain.ParentDatabase) 
 Call docMail.ReplaceItemValue("Form","Memo")
 Call docMail.ReplaceItemValue("Principal","Reporter Notification")
 Call docMail.ReplaceItemValue("ReplyTo","")
 Set body   = docMail.CreateMIMEEntity("Body")
 Set child  = body.CreateChildEntity
 
 
 Call stream.WriteText(MailText(docMain,strTempletNum))
 Call docMail.ReplaceItemValue( "Subject",MailSubject(docMain,strTempletNum))   
 
 strHtml = |<br><div style="font-size:15px; "><b><a href="|&ProfileDoc.DBHome(0) & ProfileDoc.DBPath(0) & |/0/| & docMain.UniversalID &|?opendocument"  target="_blank">请点击打开文档</a></b></div>|
 stream.WriteText(strHtml)
 
 Call docMail.ReplaceItemValue("BlindCopyTo", strSendto)
 Call child.SetContentFromText(stream, "text/html;charset=GB2312", ENC_NONE)
 Call stream.Truncate
 Call docMail.Send(False)
 s.ConvertMIME = True  
 Call docMail.Remove(True)
 
 Exit Sub
ErrorHandle:
 'iSuccess = False
 Messagebox db.FilePath & "_LSMailCommand.SendNotification:" & Error$ & " at line number " & Cstr(Erl) 
 Exit Sub
End Sub

posted @ 2010-04-08 19:41 明高 阅读(161) | 评论 (0)编辑 收藏

Excel报表统计

'Print |正在统计,请稍候...|
 Print |<script language="javascript">   |
 Print |<!--
      var oXL
      var oBook
      var oSheet1
  var oXL = new ActiveXObject("Excel.Application");       
      oBook = oXL.Workbooks.Add();
      oSheet1 = oBook.ActiveSheet; 
  oSheet1.Name = "IP-ASIC-Simulation";
  oXL.sheets(oSheet1.Name).Select;
  oXL.Range("A1:G1").Select;
  oXL.Selection.RowHeight = 28.50;
  oXL.Selection.HorizontalAlignment = 3;
  oXL.Selection.VerticalAlignment = 3 ;
  oXL.Selection.Font.Name = "宋体";
  oXL.Selection.Font.FontStyle = "加粗";
  oXL.Selection.Font.Size = 10;
  oXL.Selection.Interior.ColorIndex = 19;
  oXL.Selection.Borders.LineStyle = 1;
  oSheet1.Cells(1,1).Value = "Customer's Project";
  oSheet1.Cells(1,2).Value = "SH Project";  
  oSheet1.Cells(1,3).Value = "GID";
  oSheet1.Cells(1,4).Value = "RD Users";
    oSheet1.Cells(1,5).Value = "Layout Users";
  oSheet1.Cells(1,6).Value = "Created Time";
  oSheet1.Cells(1,7).Value = "Update Time";
  oXL.Selection.Columns.AutoFit;
  oXL.Selection.Rows.AutoFit;
  |  
 i = 2 
 
 While Not (doc Is Nothing)
  Print |oSheet1.Cells(| & Cstr(i) & |,1).Value = "| & Cstr(doc.Plan_Code_Sunplus(0)) &     |";|
  Print |oSheet1.Cells(| & Cstr(i) & |,2).Value = "| & Cstr(doc.Plan_Code_Sh(0)) &   |";|
  Print |oSheet1.Cells(| & Cstr(i) & |,3).Value = "| & Cstr(ProfileDoc.GID(0)+i-2) &    |";|
  'RDUser和LayoutUser
  For j=1 To doc.num(0)   
   strItemName   = "LoginName" & j
   Set item      = doc.GetFirstItem(strItemName)
   strUserList = strUserList + item.Text+","
  Next
  Print |oSheet1.Cells(| & Cstr(i) & |,4).Value = "| & strUserList &     |";|
  Print |oSheet1.Cells(| & Cstr(i) & |,5).Value = "| & strUserList &     |";|
  Print |oSheet1.Cells(| & Cstr(i) & |,6).Value = "| & Cstr(doc.Created) &    |";|
  Print |oSheet1.Cells(| & Cstr(i) & |,7).Value = "| & Cstr(doc.ChangeDate(0)) &   |";|
  
  i = i+1 
  Print |
   oXL.sheets(oSheet1.Name).Select;
   oXL.Range(oSheet1.Cells(2,1),oSheet1.Cells(| & Cstr(i) & |-1,7)).Select;
   oXL.Selection.Font.Name = "宋体";
   oXL.Selection.Font.Size = 10;
   oXL.Selection.Borders.LineStyle = 1;
   oXL.ReferenceStyle = 1;
   oXL.Range("A1").Select;
    |  
  Set doc  = vw.GetNextDocument(doc)
 Wend
 
 Print |oXL.Visible  =  true; |
 Print |window.history.go(-1); |
 'Print |window.close();  |
 Print |-->    |
 Print |</script>   |

posted @ 2010-04-08 19:39 明高 阅读(188) | 评论 (0)编辑 收藏

关于函件收集

基本原理:函件收集针对异域domino服务器的notes数据库进行信息的传递。
启动administrator端,选择"People&Group"的标签;
展开"Mail-In Database and Resources",添加“函件收集数据库”;
以新闻数据库为例:
函件收集数据库名称:dccnews(随意)
Internet地址:dccnews@ibm.com
网络域:ibm
服务器:mingle/ibm
文件名:oa/dccnews.nsf

说明:dccnews@ibm.com为邮件的通信地址,不需要单独为此在names.nsf中注册。只需要将其在外发的邮件服务器中设置,这样进来的邮件可以识别即可。我们可以通过创建类型为“邮件进入时”的代理即可解析和接收邮件的信息。

posted @ 2010-04-08 19:25 明高 阅读(205) | 评论 (0)编辑 收藏

Lotus表单中的内置域

$Conflict
如果文档中有此域产生,则标志此域为冲突文档。

posted @ 2010-04-08 19:23 明高 阅读(133) | 评论 (0)编辑 收藏

Lotus表单中未公开的域

$$QuerySaveAgent
功能:等价于表单中的WebQuerySave事件。

posted @ 2010-04-08 19:04 明高 阅读(141) | 评论 (0)编辑 收藏

仅列出标题
共3页: 上一页 1 2 3 下一页 
<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

导航

统计

常用链接

留言簿

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜