📄 frmbillmanage.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmBillManage
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "查看运单"
ClientHeight = 6825
ClientLeft = 45
ClientTop = 435
ClientWidth = 11895
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 7913.043
ScaleMode = 0 'User
ScaleWidth = 11895
Begin VB.CommandButton cmdAllView
Caption = "全部预览"
Height = 328
Left = 6600
TabIndex = 10
Top = 840
Width = 1020
End
Begin VB.CommandButton cmdOnePrint
Caption = "单条打印"
Height = 328
Left = 5160
TabIndex = 9
Top = 840
Width = 1020
End
Begin VB.CommandButton cmdOneView
Caption = "单条预览"
Height = 328
Left = 3720
TabIndex = 8
Top = 840
Width = 1020
End
Begin VB.CommandButton cmdAllPrint
Caption = "全部打印"
Height = 328
Left = 8040
TabIndex = 7
Top = 840
Width = 1020
End
Begin VB.CommandButton cmdQuery
Caption = "查 询"
Height = 328
Left = 2280
TabIndex = 6
Top = 840
Width = 1020
End
Begin VB.CommandButton cmdNext
Caption = "下一页"
Height = 259
Left = 10680
TabIndex = 3
Top = 960
Width = 800
End
Begin VB.CommandButton cmdForWard
Caption = "上一页"
Height = 259
Left = 9720
TabIndex = 2
Top = 960
Width = 800
End
Begin VB.Frame Frame1
Height = 5295
Left = 360
TabIndex = 1
Top = 1320
Width = 11175
Begin MSComctlLib.ListView lsvTraffic
Height = 4815
Left = 240
TabIndex = 4
Top = 240
Width = 10755
_ExtentX = 18971
_ExtentY = 8493
View = 3
LabelEdit = 1
LabelWrap = 0 'False
HideSelection = 0 'False
AllowReorder = -1 'True
FullRowSelect = -1 'True
_Version = 393217
SmallIcons = "ilst16x16"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 0
End
End
Begin VB.Label Label2
AutoSize = -1 'True
Height = 180
Left = 9000
TabIndex = 5
Top = 240
Width = 90
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "结 算 管 理"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4200
TabIndex = 0
Top = 240
Width = 3480
End
End
Attribute VB_Name = "frmBillManage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim total As Integer
Dim MaxPage As Integer
Dim NowPage As Integer
Dim arrProduct
Dim arrstation
Dim arrclient
Dim strsql As String
Dim DB As New clsDataBase
Private Sub cmdAllPrint_Click()
Dim ir As Integer
Dim strTtaffic As String
ir = 1
For ir = 1 To lsvTraffic.ListItems.Count
If IsNumeric(lsvTraffic.ListItems.Item(ir).Tag) Then
strTtaffic = strTtaffic & sys.TextTolong(lsvTraffic.ListItems.Item(ir).Tag) & ","
End If
Next
If strTtaffic <> "" Then
'取得数据
Dim inum As Integer
Dim isfind As Boolean
Dim strTemp As String
Dim rs As New ADODB.Recordset
strsql = "SELECT * FROM TRAFFIC WHERE ID in (" & Left(strTtaffic, Len(strTtaffic) - 1) & ")"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not rs.EOF Then
Dim wordApp As New Word.Application
Dim mysel As Word.Selection
Dim oTable As Word.Table
wordApp.Documents.Add
wordApp.Visible = True
wordApp.Activate
Set mysel = wordApp.Selection
With mysel
Do While Not rs.EOF
.TypeParagraph
.TypeParagraph
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Paragraphs.Last.Range.Font.Name = "楷体_GB2312"
.Paragraphs.Last.Range.Font.Bold = False
.Paragraphs.Last.Range.Font.Size = 10
.TypeText Text:="第一联:存根"
.TypeParagraph
.TypeParagraph
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Paragraphs.Last.Range.Font.Bold = True
.Paragraphs.Last.Range.Font.Size = 20
.TypeText Text:="运 输 结 算 单"
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Paragraphs.Last.Range.Font.Bold = False
.Paragraphs.Last.Range.Font.Size = 12
'客户
inum = 0
isfind = False
strTemp = ""
For inum = 0 To UBound(arrclient, 2)
If arrclient(0, inum) = sys.TextTolong(rs("SENDER")) Then
strTemp = strTemp & "客户名称:" & sys.StrToText(arrclient(1, inum)) & " 发货日期:" & sys.StrToText(rs("DATENUM"))
isfind = True
Exit For
End If
Next
If isfind = False Then
strTemp = strTemp & "客户名称: " & " 发货日期:" & sys.StrToText(rs("DATENUM"))
End If
.TypeText Text:=strTemp
.TypeParagraph
'发站
inum = 0
isfind = False
strTemp = ""
For inum = 0 To UBound(arrstation, 2)
If arrstation(0, inum) = sys.TextTolong(rs("SENDSTATION")) Then
strTemp = strTemp & "发站:" & arrstation(1, inum) & " "
isfind = True
Exit For
End If
Next
If isfind = False Then
strTemp = strTemp & "发站: "
End If
'到站
inum = 0
isfind = False
For inum = 0 To UBound(arrstation, 2)
If arrstation(0, inum) = sys.TextTolong(rs("RECEIVESTATION")) Then
strTemp = strTemp & "到站:" & arrstation(1, inum) & " 重量:" & sys.StrToText(rs("WEIGHT")) & "吨"
isfind = True
Exit For
End If
Next
If isfind = False Then
strTemp = strTemp & "到站 : 重量:" & sys.StrToText(rs("WEIGHT")) & "吨"
End If
.TypeText Text:=strTemp
.TypeParagraph
.Tables.Add Range:=.Range, NumRows:=7, NumColumns:=4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
Set oTable = .Tables(1)
With oTable
.Cell(1, 1).Width = 80
.Cell(1, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(1, 1).Range.Text = "车号:"
.Cell(1, 2).Width = 133
.Cell(1, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -