⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uwenjianguidang.ctl

📁 公文管理系统》是一套通过行文收发
💻 CTL
📖 第 1 页 / 共 5 页
字号:
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc4"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label lbl记录数 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      ForeColor       =   &H80000008&
      Height          =   330
      Left            =   5490
      TabIndex        =   27
      Top             =   7500
      Width           =   1095
   End
   Begin VB.Label lblLabels 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "共有记录数:"
      ForeColor       =   &H80000008&
      Height          =   330
      Index           =   10
      Left            =   3960
      TabIndex        =   26
      Top             =   7500
      Width           =   990
   End
End
Attribute VB_Name = "UWenJianGuiDang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public pIP As String
Public pConn As String
Dim strUserName As String
Private Sub cmdPrint_Click()
'***********************************************
'    for Word 2000
'***********************************************
'    Dim strSQL As String
'    Dim rsTmp As New ADODB.Recordset
'    Dim conn As New ADODB.Connection
'    Dim oWrd As Object, i As Integer
'    Dim str保管卷号 As String
'
'    str保管卷号 = txtFields(2).Text
'
'    Set oWrd = CreateObject("Word.Application")
'    oWrd.Visible = True
'    oWrd.Activate
'    oWrd.Documents.Add
'
'    With oWrd.ActiveDocument.PageSetup
'        .TopMargin = 60
'        .BottomMargin = 40
'        .LeftMargin = 66
'        .RightMargin = 66
'        .Gutter = 28.35
'        .HeaderDistance = 30
'        .FooterDistance = 48
'        .PageWidth = 595.3
'        .PageHeight = 841.9
'    End With
'
'    With oWrd.Selection
'
'      .ParagraphFormat.Alignment = 1
'      .Font.Size = 20    '小四
'      .Font.Name = "宋体"
'      .Font.Bold = True
'      .TypeText "卷  内  文  件  目  录"
'      .TypeParagraph
'
'      .Font.Size = 10
'      .Font.Bold = False
'
'      .Tables.Add Range:=.Range, NumRows:=2, NumColumns:=6   ', AutoFitBehavior:=0
''      .Cells.VerticalAlignment = 1
'      .Tables(1).Columns(1).SetWidth ColumnWidth:=56, RulerStyle:=0
'      .Tables(1).Columns(2).SetWidth ColumnWidth:=70, RulerStyle:=0
'      .Tables(1).Columns(3).SetWidth ColumnWidth:=56, RulerStyle:=0
'      .Tables(1).Columns(4).SetWidth ColumnWidth:=120, RulerStyle:=0
'      .Tables(1).Columns(5).SetWidth ColumnWidth:=56, RulerStyle:=0
'      .Tables(1).Columns(6).SetWidth ColumnWidth:=60, RulerStyle:=0
'      .Tables(1).Rows(1).SetHeight RowHeight:=30, HeightRule:=2
'      .Tables(1).Rows(2).SetHeight RowHeight:=30, HeightRule:=2
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="年    度"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(0).Text
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="单    位"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=DataCombo1.Text
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="保管卷号"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(2).Text
'      .MoveLeft unit:=12, Count:=5
'      .MoveDown unit:=5
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="保管期限"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(3).Text
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="起止日期"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(5).Text
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .TypeText Text:="卷内页数"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(6).Text
'
'      .MoveDown unit:=5, Count:=1
'
'      .Tables.Add Range:=.Range, NumRows:=1, NumColumns:=2   ', AutoFitBehavior:=0
''      .Cells.VerticalAlignment = 1
'      .Cells(1).SetWidth ColumnWidth:=36, RulerStyle:=0
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).TopPadding = 10
'      .Cells(1).BottomPadding = 10
'      .Cells(1).LeftPadding = 12
'      .Cells(1).RightPadding = 12
'      .Cells(1).WordWrap = True
'      .Cells(1).FitText = False
'      .TypeText Text:="案卷题名"
'      .MoveRight unit:=12
'      .Cells(1).SetWidth ColumnWidth:=382, RulerStyle:=0
'      .ParagraphFormat.Alignment = 3
'      .TypeText Text:=txtFields(7).Text
'
'      .MoveDown unit:=5, Count:=1
'
'      conn.ConnectionString = pConn
'      conn.Open
'
'      '子表
'      strSQL = "SELECT 顺序号, 文号, 责任者, 题名, 日期, 页次, 备注 From 卷内文件目录 WHERE 保管卷号 = " & str保管卷号
'      rsTmp.Open strSQL, conn, adOpenStatic, adLockReadOnly
'      rsTmp.MoveLast
'      rsTmp.MoveFirst
'      i = rsTmp.RecordCount
''        .Tables.Add Range:=.Range, NumRows:=Int(i / 2 + 0.5) + 1, NumColumns:=8, DefaultTableBehavior:=1, AutoFitBehavior:=0
'      .Tables.Add Range:=.Range, NumRows:=i + 1, NumColumns:=7 ', AutoFitBehavior:=0
''      .Cells.VerticalAlignment = 1
'      .ParagraphFormat.Alignment = 1
'      .ParagraphFormat.LineSpacing = 10
'      .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'      .Cells(1).TopPadding = 4
'      .Cells(1).BottomPadding = 4
'      .Cells(1).WordWrap = True
'      .Cells(1).FitText = False
'      .TypeText Text:="顺序号"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=50, RulerStyle:=0
'      .TypeText Text:="文  号"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=50, RulerStyle:=0
'      .TypeText Text:="责任者"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=200, RulerStyle:=0
'      .TypeText Text:="题                        名"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=58, RulerStyle:=0
'      .TypeText Text:="日  期"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'      .TypeText Text:="页次"
'      .MoveRight unit:=12
'      .ParagraphFormat.Alignment = 1
'      .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'      .TypeText Text:="备注"
'      For i = 1 To rsTmp.RecordCount
'        .Tables(1).Rows(i + 3).SetHeight RowHeight:=30, HeightRule:=2
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'        .TypeText Text:=CStr(IIf(IsNull(rsTmp.Fields("顺序号").Value), "", rsTmp.Fields("顺序号").Value))
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=50, RulerStyle:=0
'        .TypeText Text:=CStr(IIf(IsNull(rsTmp.Fields("文号").Value), "", rsTmp.Fields("文号").Value))
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=50, RulerStyle:=0
'        .TypeText Text:=IIf(IsNull(rsTmp.Fields("责任者").Value), "", rsTmp.Fields("责任者").Value)
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=200, RulerStyle:=0
'        .TypeText Text:=IIf(IsNull(rsTmp.Fields("题名").Value), "", rsTmp.Fields("题名").Value)
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=58, RulerStyle:=0
'        .TypeText Text:=CStr(IIf(IsNull(rsTmp.Fields("日期").Value), "", Format(rsTmp.Fields("日期").Value, "yyyy-mm-dd")))
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'        .TypeText Text:=CStr(IIf(IsNull(rsTmp.Fields("页次").Value), "", rsTmp.Fields("页次").Value))
'        .MoveRight unit:=12
'        .ParagraphFormat.Alignment = 3
'        .Cells(1).SetWidth ColumnWidth:=20, RulerStyle:=0
'        .TypeText Text:=CStr(IIf(IsNull(rsTmp.Fields("备注").Value), "", rsTmp.Fields("备注").Value))
'        rsTmp.MoveNext
'      Next
'
'      .Tables(1).Select
'      .Cells.VerticalAlignment = 1
'
'      .HomeKey unit:=6
'
'    End With
'
'    Set oWrd = Nothing
'    Set conn = Nothing
'    Set rsTmp = Nothing

'***********************************************
'    for Word 97
'***********************************************
    Dim strSQL As String
    Dim rsTmp As New ADODB.Recordset
    Dim conn As New ADODB.Connection
    Dim oWrd As Object, i As Integer
    Dim str保管卷号 As String
    
    str保管卷号 = txtFields(2).Text

    Set oWrd = CreateObject("Word.Application")
    oWrd.Visible = True
    oWrd.Activate
    oWrd.Documents.Add

    With oWrd.ActiveDocument.PageSetup
        .TopMargin = 60
        .BottomMargin = 40
        .LeftMargin = 66
        .RightMargin = 66
        .Gutter = 28.35
        .HeaderDistance = 30
        .FooterDistance = 48
        .PageWidth = 595.3
        .PageHeight = 841.9
    End With
    
    With oWrd.Selection
      
      .ParagraphFormat.Alignment = 1
      .Font.Size = 20    '小四
      .Font.Name = "宋体"
      .Font.Bold = True
      .TypeText "卷  内  文  件  目  录"
      .TypeParagraph
      
      .Font.Size = 10
      .Font.Bold = False
           
      .Tables.Add Range:=.Range, NumRows:=2, NumColumns:=6   ', AutoFitBehavior:=0
      .Tables(1).Columns(1).SetWidth ColumnWidth:=56, RulerStyle:=0
      .Tables(1).Columns(2).SetWidth ColumnWidth:=70, RulerStyle:=0
      .Tables(1).Columns(3).SetWidth ColumnWidth:=56, RulerStyle:=0
      .Tables(1).Columns(4).SetWidth ColumnWidth:=120, RulerStyle:=0
      .Tables(1).Columns(5).SetWidth ColumnWidth:=56, RulerStyle:=0
      .Tables(1).Columns(6).SetWidth ColumnWidth:=60, RulerStyle:=0
      .Tables(1).Rows(1).SetHeight RowHeight:=30, HeightRule:=2
      .Tables(1).Rows(2).SetHeight RowHeight:=30, HeightRule:=2
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="年    度"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(0).Text
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="单    位"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=DataCombo1.Text
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="保管卷号"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(2).Text
      .MoveLeft unit:=12, Count:=5
      .MoveDown unit:=5
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="保管期限"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(3).Text
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="起止日期"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(5).Text
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="卷内页数"
      .MoveRight unit:=12
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(6).Text
      
      .MoveDown unit:=5, Count:=1
      
      .Tables.Add Range:=.Range, NumRows:=1, NumColumns:=2   ', AutoFitBehavior:=0
      .Cells(1).SetWidth ColumnWidth:=24, RulerStyle:=0
      .Tables(1).Rows(3).SetHeight RowHeight:=60, HeightRule:=2
      .ParagraphFormat.Alignment = 1
      .TypeText Text:="案卷题名"
      .MoveRight unit:=12
      .Cells(1).SetWidth ColumnWidth:=394, RulerStyle:=0
      .ParagraphFormat.Alignment = 3
      .TypeText Text:=txtFields(7).Text
      
      .MoveDown unit:=5, Count:=1
      
      conn.ConnectionString = pConn
      conn.Open

      '子表
      strSQL = "SELECT 顺序号, 文号, 责任者, 题名, 日期, 页次, 备注 From 卷内文件目录 WHERE 保管卷号 = " & str保管卷号
      rsTmp.Open strSQL, conn, adOpenStatic, adLockReadOnly
      rsTmp.MoveLast
      rsTmp.MoveFirst
      i = rsTmp.RecordCount
'        .Tables.Add Range:=.Range, NumRows:=Int(i / 2 + 0.5) + 1, NumColumns:=8, DefaultTableBehavior:=1, AutoFitBehavior:=0
      .Tables.Add Range:=.Range, NumRows:=i + 1, NumColumns:=7 ', AutoFitBehavior:=0
      .Cells.VerticalAlignment = 1
      .ParagraphFormat.Alignment = 1
      .ParagraphFormat.LineSpacing = 10
      .Cells(1).SetWidth ColumnWidth:=24, RulerStyle:=0
      .Tables(1).Rows(4).SetHeight RowHeight:=50, HeightRule:=2

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -