?? frmtmpfw.frm
字號:
' DoEvents
' Next
' wddoc.SaveAs (txtfwYWPath + doc.GetItemValue("DocID")(0) + "(yj).doc") '另存為一個文檔
' wddoc.Close
' Set wddoc = Nothing
' wdapp.Quit
' ''''''''''''''''''''''''''''''''''''''''''''''end
'' ''''''''''''''''''''''''''''''''' 從配置文檔中取出意見字段的對應值
'' Me.List3.Clear
'' Me.List4.Clear
''
'' 'Dim tmpj As Integer
'' For tmpj = 0 To UBound(AllAdviceNames)
'' AdviecName = Split(AllAdviceNames(tmpj), "=")
'' Me.List3.AddItem AdviecName(1) 'list3中存放關系數(shù)據(jù)庫中字段的名稱,即=右邊的
'' Me.List4.AddItem AdviecName(0) 'list4中存放Domino數(shù)據(jù)庫中對應的域名,即=左邊的
'' Next
'' ''''''''''''''''''''''''''''''''
'' For tmpj = 0 To List3.ListCount - 1
'' If doc.HasItem(List4.List(tmpj)) Then
'' rs.Fields(List3.List(tmpj)) = CStr(doc.GetFirstItem(List4.List(tmpj)).Text)
'' End If
'' Next
''
' ''''''''''''''''''''''''''''''''''''''''''''''end
' Call getMaxID '得到目錄表中的最大id
'
'
' '''''''''''導出原文
' Dim allItem As NotesItem
'
' Dim strAttDocID As String
' strAttDocID = doc.GetItemValue("AttDocID")(0)
' Dim AttView As NotesView
' Dim Attdc As NotesDocumentCollection
' Dim Attdoc As NotesDocument
' Dim i As Variant
' Dim o As Variant
' Dim emb As Variant
' Dim AttObjects As NotesEmbeddedObject
' Dim path As String
' Dim entPath As String
' Dim count As Integer
' Dim docRS As New ADODB.Recordset
' docRS.Open "select * from " & txtfwYW, Gcon_main, adOpenDynamic, adLockOptimistic
' count = 0
' path = txtfwYWPath '存放附件的路徑,到時候你可以修改成你們的路徑
' ''''''''''''''''''' 把生成的word文檔信息存到sys_link 中
' docRS.AddNew
' docRS.Fields("I_TBLID") = 29
' docRS.Fields("I_RECID") = MaxID
' docRS.Fields("C_NUM") = count
' docRS.Fields("C_EXPLAIN") = "意見"
' docRS.Fields("C_LINK") = txtfwYWHttpPath + doc.GetItemValue("DocID")(0) + "(yj).doc"
' docRS.Update
'
' '''''''''''''''''''end
' ''''''拆離文檔中的附件
' If strAttDocID <> "" Then
' Set AttView = PublicNotesDb.GetView("(AttachUnid)")
'
' Set Attdoc = AttView.GetDocumentByKey(strAttDocID)
' If Attdoc.HasEmbedded Then
' Dim attitem As NotesItem
' Set attitem = Attdoc.GetFirstItem("attnames")
'
' For Each i In attitem.Values
' Set AttObjects = Attdoc.GetAttachment(i)
' entPath = path + strAttDocID + "_" + CStr(count) + "_" + Right(AttObjects.Source, 4)
' Call AttObjects.ExtractFile(entPath) ''''把附件拆到指定的路徑下
' '''''''往原文表中添加相應的紀錄
' docRS.AddNew
' docRS.Fields("I_TBLID") = 29
' docRS.Fields("I_RECID") = MaxID
' docRS.Fields("C_NUM") = count + 1
' docRS.Fields("C_EXPLAIN") = "正文"
' docRS.Fields("C_LINK") = txtfwYWHttpPath + strAttDocID + "_" + CStr(count) + "_" + Right(AttObjects.Source, 4)
'
' docRS.Update
'
' '''''''''''''''''''''''''''''''''''end
' count = count + 1
'
' Next
' End If
' End If
'
'
' ''''''''''''''''''拆離發(fā)文中的嵌入式文檔,包括紅頭文件和過程性文件
' Dim strExplain As String
' For Each i In Session.Evaluate("@AttachmentNames", doc)
' Set AttObjects = doc.GetAttachment(i)
' If AttObjects Is Nothing Then
' Else
' If InStr(1, AttObjects, "modify") > 0 Then
' entPath = doc.GetItemValue("docId")(0) + "(modify)" + Right(AttObjects.Source, 4)
' Call AttObjects.ExtractFile(path + entPath)
' strExplain = "過程性文件2"
' ElseIf InStr(1, AttObjects, "draft") > 0 Then
' entPath = doc.GetItemValue("docId")(0) + "(draft)" + Right(AttObjects.Source, 4)
' Call AttObjects.ExtractFile(path + entPath)
' strExplain = "過程性文件1"
' Else
' entPath = doc.GetItemValue("docId")(0) + Right(AttObjects.Source, 4)
' Call AttObjects.ExtractFile(path + entPath)
' strExplain = "正文"
' End If
'
' docRS.AddNew
' docRS.Fields("I_TBLID") = 29
' docRS.Fields("I_RECID") = MaxID
' docRS.Fields("C_NUM") = count + 1
' docRS.Fields("C_EXPLAIN") = strExplain
' docRS.Fields("C_LINK") = txtfwYWHttpPath + entPath '需要修改,改成你們的相應連接
' docRS.Update
' End If
' count = count + 1
' Next
'
' '''''''''''''''''''''''''''''''''''''''''''''end
' End If
' Gcon_main.Execute "delete from 臨時文書檔案一文一件 where ID=" & usql
'
' tmpRS.Close
' rs.Close
' docRS.Close
'
' Set item = doc.ReplaceItemValue("ISENDARC", "1")
' Call doc.Save(True, True)
' Next
' Call GridEX1.Refresh
'
' MsgBox "數(shù)據(jù)導入成功!"
'End Sub
'
'Private Sub Form_Load()
'
'Dim C As NotesViewColumn
'
'Dim Mycount As Integer
''''連接到Domino數(shù)據(jù)庫
'Set PublicNotesDb = Session.GetDatabase(txtfwDominoServer, txtfwDominoDatabase) '需要修改 ,前面是oa服務器的名稱(這個需要修改的)。后面是數(shù)據(jù)庫的名稱(這個應該不用改,這個路經(jīng)和你們現(xiàn)在的路徑是一致的)
'
'If PublicNotesDb Is Nothing Then
'
' MsgBox ("不能打開Notes庫,請查看系統(tǒng)設置!")
'
'End If
'Gcon_main.Execute "Delete from 臨時文書檔案一文一件" '首先刪除臨時表里面的數(shù)據(jù)
'Dim rs As New ADODB.Recordset
'rs.Open "Select * from 臨時文書檔案一文一件", Gcon_main, adOpenDynamic, adLockOptimistic
'
'Dim j As Integer
'Set view = PublicNotesDb.GetView(txtfwview) '得到存放辦結文件的試圖
'
'Dim doc As NotesDocument
'Set doc = view.GetFirstDocument
'Dim i As Integer
'
'''''''''''''''''''''''''''''''''' 從配置文檔中取出字段的對應值
'Me.List1.Clear
'Me.List2.Clear
'Dim OldNames() As String
'Dim name() As String
'OldNames = Split(txtfwZD, ",")
'Dim tmpj As Integer
'For tmpj = 0 To UBound(OldNames)
' name = Split(OldNames(tmpj), "=")
' Me.List1.AddItem name(1) 'list1中存放關系數(shù)據(jù)庫中字段的名稱,即=左邊的
' Me.List2.AddItem name(0) 'list1中存放Domino數(shù)據(jù)庫中對應的域名,即=右邊的
'Next
'''''''''''''''''''''''''''''''''
'Dim strTmpYear As String
'While i < 200
' '取出導出標記為空,創(chuàng)建超過2個月的文檔
' 'If doc.GetFirstItem("TagOfDyp") Is Nothing And DateDiff("m", CDate(doc.Created), CDate(Now)) > 2 Then
' If doc Is Nothing Then
' i = i + 1
' Else
'
' 'If doc.GetFirstItem("ISENDARC") Is Nothing And doc.GetItemValue("ISNEEDARC")(0) = "1" And DateDiff("m", CDate(doc.Created), CDate(Now)) > 2 Then
' If doc.GetFirstItem("ISENDARC") Is Nothing And doc.GetItemValue("ISNEEDARC")(0) = "1" And DateDiff("m", CDate(doc.Created), CDate(Now)) > 2 Then
' rs.AddNew
' For tmpj = 0 To List1.ListCount - 1
' If List1.List(tmpj) = "成文日期" Then
' rs.Fields(List1.List(tmpj)) = Left(GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text), 10)
' strTmpYear = Left(GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text), 4)
' ElseIf List1.List(tmpj) = "收發(fā)日期" Then
' rs.Fields(List1.List(tmpj)) = Left(GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text), 10)
' ElseIf List1.List(tmpj) = "備注" Then
' rs.Fields(List1.List(tmpj)) = GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text) + "(部門發(fā)文)"
' ElseIf List1.List(tmpj) = "責任者" Then
' rs.Fields(List1.List(tmpj)) = "江西省電信公司" + GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text)
' ElseIf List1.List(tmpj) = "年度" Then
' rs.Fields(List1.List(tmpj)) = strTmpYear
' Else
' rs.Fields(List1.List(tmpj)) = GetNotNull(doc.GetFirstItem(List2.List(tmpj)).Text)
' End If
' Next
' rs.Update
'
' i = i + 1
' End If
'
' Set doc = view.GetNextDocument(doc)
' DoEvents
' End If
' Wend
'
'Call ShowGridEX1
'If rs.EOF And rs.BOF Then
'Else
' rs.MoveFirst
'End If
''''''''''添加公文編號和題名到查詢條件中
'Do While Not rs.EOF
'
' If Not IsNull(rs!文號) Then
' If rs!文號 <> "" Then
' Combo2.AddItem rs!文號
' End If
' End If
'
' If Not IsNull(rs!題名) Then
' If rs!題名 <> "" Then
' Combo4.AddItem rs!題名
' End If
'
' End If
'
' rs.MoveNext
'Loop
'''''''''''''''''''''''''
'Exit Sub
'err_main:
' MsgBox "系統(tǒng)連接數(shù)據(jù)庫失敗,可能是以下原因:" & _
' Chr(13) & Chr(10) & _
' "1、數(shù)據(jù)庫服務沒有啟動!" & _
' Chr(13) & Chr(10) & _
' "2、數(shù)據(jù)庫連接參數(shù)設置不正確!" & _
' Chr(13) & Chr(10) & _
' "3、網(wǎng)絡連接不正確!" & _
' Chr(13) & Chr(10) & _
' Chr(13) & Chr(10) & _
' "請檢查無誤后重新運行系統(tǒng)。" & _
' Chr(13) & Chr(10) & Chr(13) & Chr(10) & "詳細錯誤信息如下:" & Chr(13) & Chr(10) & "[" & Err.Number & "]" & Err.Description, vbInformation + vbOKOnly, "信息"
'End Sub
'Private Sub ShowGridEX1()
' Dim rs As New ADODB.Recordset
'
' rs.Open "Select * from 臨時文書檔案一文一件", Gcon_main, adOpenDynamic, adLockReadOnly
' Set GridEX1.ADORecordset = rs
' If GridEX1.Columns(GridEX1.Columns.count).Caption = "ID" Then GridEX1.Columns(GridEX1.Columns.count).Width = 0 '隱含ID
'
'End Sub
'Private Sub getMaxID()
' Dim rs As New ADODB.Recordset
' rs.Open "select max(ID) as maxid from " & txtfwTable, Gcon_main, adOpenDynamic, adLockReadOnly
' MaxID = rs.Fields("maxid")
'End Sub
'Public Function GetNotNull(O_value As Variant, Optional ByVal vtype As Integer = 2) As Variant
'Select Case vtype
'Case 1
' GetNotNull = IIf(IsNull(O_value), 0, O_value)
'Case 2
' GetNotNull = IIf(IsNull(O_value), "", O_value)
'Case 3
' GetNotNull = IIf(IsNull(O_value), Now, O_value)
'End Select
'End Function
'
'
'Private Sub Form_Unload(Cancel As Integer)
'Me.Hide
'End Sub
'
'
'Private Sub mnuall_Click()
'Call ShowGridEX1
'End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -