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 on 2010-04-08 19:50 明高 閱讀(424) 評論(0)  編輯  收藏 所屬分類: Lotus

          <2010年4月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          導航

          統計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 无棣县| 兴隆县| 乌海市| 嘉善县| 潼关县| 德阳市| 肃宁县| 哈巴河县| 海门市| 伊宁县| 淮南市| 金塔县| 黄浦区| 葫芦岛市| 察雅县| 宁明县| 亚东县| 尉犁县| 麟游县| 华容县| 钟祥市| 诏安县| 佳木斯市| 漾濞| 襄汾县| 威宁| 新丰县| 莱芜市| 奉贤区| 洛浦县| 万安县| 津南区| 青田县| 东丽区| 姜堰市| 柘城县| 集贤县| 大英县| 安多县| 南京市| 包头市|