Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

列印_零用金支付單.vb 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. Option Strict Off
  2. Imports System.Data.SqlClient
  3. Imports System.IO
  4. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  5. Imports Microsoft.Office.Interop.Excel.Constants
  6. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  7. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  8. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  9. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  10. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  11. Imports Microsoft.Office.Interop.Excel.XlWindowState
  12. Imports Microsoft.Office.Interop.Excel
  13. Public Class 列印_零用金支付單
  14. ReadOnly conn As New SqlConnection
  15. ReadOnly da As New SqlDataAdapter
  16. ReadOnly cmd As New SqlCommand
  17. ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet : ReadOnly ds3 As New DataSet : ReadOnly ds4 As New DataSet
  18. Dim dr As SqlDataReader
  19. Dim N1 As Integer : Dim N2 As Integer
  20. Dim xlApp As Application
  21. Dim xlBook As Workbook
  22. Dim xlSheet As Worksheet
  23. Dim 位置1 As String
  24. ReadOnly QRCODE As DotNetBarcode = New DotNetBarcode
  25. Private Sub Set_DGV1載入前設定()
  26. DataGridView1.DataSource = Nothing : ds1.Clear()
  27. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  28. DataGridView1.ColumnHeadersHeight = 25
  29. DataGridView1.AllowUserToAddRows = False
  30. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  31. End Sub
  32. Private Sub Set_DGV1載入後設定()
  33. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds1) : DataGridView1.DataSource = ds1.Tables(0) : conn.Close()
  34. End Sub
  35. Private Sub Set_訂單清單1()
  36. Set_DGV1載入前設定()
  37. SQL1 = "SELECT 零用金支付表.流水號, 零用金支付表.部門, 零用金支付表.申請人, LEFT(零用金支付表.申請日期, 10) AS 申請日期,
  38. 零用金支付表.審核人, LEFT(零用金支付表.審核日期, 10) AS 審核日期, 零用金支付表.核准人,
  39. LEFT(零用金支付表.核准日期, 10) AS 核准日期, 零用金支付表.核准圖檔, 零用金支付表.簽名編碼,
  40. 零用金支付明細.出納 AS 已出納
  41. FROM 零用金支付表 INNER JOIN
  42. 零用金支付明細 ON 零用金支付表.流水號 = 零用金支付明細.流水號
  43. WHERE (零用金支付表.流水號 LIKE N'" & 列印用SQL & "') AND (零用金支付表.審核人 NOT LIKE N'作廢%') AND (零用金支付表.審核人 NOT LIKE N'') AND
  44. (零用金支付表.核准人 NOT LIKE N'作廢%') AND (零用金支付表.核准人 NOT LIKE N'')
  45. GROUP BY 零用金支付表.流水號, 零用金支付表.部門, 零用金支付表.申請人, LEFT(零用金支付表.申請日期, 10),
  46. 零用金支付表.審核人, LEFT(零用金支付表.審核日期, 10), 零用金支付表.核准人, LEFT(零用金支付表.核准日期, 10),
  47. 零用金支付表.核准圖檔, 零用金支付表.簽名編碼, 零用金支付明細.出納
  48. ORDER BY 零用金支付表.流水號 DESC"
  49. Set_DGV1載入後設定()
  50. End Sub
  51. Private Sub Set_DGV2載入前設定()
  52. DataGridView2.DataSource = Nothing : ds2.Clear()
  53. DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  54. DataGridView2.ColumnHeadersHeight = 25
  55. DataGridView2.AllowUserToAddRows = False
  56. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  57. End Sub
  58. Private Sub Set_訂單清單2()
  59. Set_DGV2載入前設定()
  60. SQL1 = 列印用SQL2
  61. Set_DGV2載入後設定()
  62. End Sub
  63. Private Sub Set_DGV2載入後設定()
  64. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds2) : DataGridView2.DataSource = ds2.Tables(0) : conn.Close()
  65. End Sub
  66. Private Sub Set_格式設定()
  67. DataGridView1.Visible = False : DataGridView2.Visible = False
  68. PictureBox1.Visible = False
  69. End Sub
  70. Private Sub 列印_零用金支付單_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  71. Set_格式設定()
  72. FormBorderStyle = FormBorderStyle.SizableToolWindow : ControlBox = False
  73. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  74. SQL1 = "SELECT 簽名檔圖片 FROM HX主管簽名檔管理 WHERE 圖片流水號 LIKE N'" & 簽核圖片編號 & "'"
  75. cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
  76. While dr.Read() = True
  77. Dim unused As Byte() = New Byte(-1) {}
  78. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  79. Dim oStream As New MemoryStream(bytes)
  80. PictureBox1.Image = Bitmap.FromStream(oStream)
  81. End While
  82. conn.Close()
  83. Set_訂單清單1() : Set_訂單清單2()
  84. End Sub
  85. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  86. xlApp = CType(CreateObject("Excel.Application"), Application)
  87. xlBook = xlApp.Workbooks.Add
  88. xlApp.DisplayAlerts = True
  89. xlBook.Activate()
  90. xlSheet = NewMethod(xlBook)
  91. xlSheet.Activate()
  92. xlApp.Visible = True
  93. xlApp.Application.WindowState = xlMaximized
  94. xlSheet.Cells(1, 1) = "費用報銷單/Penggantian biaya" : xlSheet.Cells(2, 1) = "報銷部門/Departemen : " : xlSheet.Cells(2, 4) = "申請人/Pemohon : "
  95. xlSheet.Cells(2, 6) = "申請日期/Tanggal_Aplikasi : " : xlSheet.Cells(3, 1) = "項次/Item"
  96. xlSheet.Cells(3, 2) = "用途/Konten" : xlSheet.Cells(3, 5) = "金額/Jumlah" : xlSheet.Cells(3, 6) = "備註/Komentar"
  97. xlSheet.Cells(2, 3) = DataGridView1.Rows(0).Cells("部門").Value : xlSheet.Cells(2, 5) = DataGridView1.Rows(0).Cells("申請人").Value
  98. xlSheet.Cells(2, 8) = DataGridView1.Rows(0).Cells("申請日期").Value
  99. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  100. xlSheet.Cells(i + 4, 1) = i + 1
  101. xlSheet.Cells(i + 4, 2) = DataGridView2.Rows(i).Cells("Konten").Value
  102. xlSheet.Cells(i + 4, 5) = DataGridView2.Rows(i).Cells("Jumlah").Value
  103. xlSheet.Cells(i + 4, 6) = DataGridView2.Rows(i).Cells("Komentar").Value
  104. With xlApp.Selection
  105. .Font.Bold = True
  106. End With
  107. N1 = i + 4 : N2 = i + 4
  108. Next i
  109. TextBox1.Text = DataGridView1.Rows(0).Cells("簽名編碼").Value : PictureBox2.Image = Nothing
  110. PictureBox2.Image = New Bitmap(PictureBox2.Width, PictureBox2.Height)
  111. Dim GP As Graphics = Graphics.FromImage(PictureBox2.Image)
  112. QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0 : QRCODE.QRWriteBar(TextBox1.Text, 0, 0, 14, GP)
  113. PictureBox2.SizeMode = 4
  114. xlSheet.Cells(N1 + 1, 2) = "以下空白/Mengikuti kosong" : xlSheet.Cells(N1 + 3, 4) = "合計/Total" : xlSheet.Cells(N1 + 3, 5) = "=SUM(E4:E" & N1 + 1 & ")"
  115. xlSheet.Cells(N1 + 3, 1) = "單據驗證碼/Verifikasi : " : xlSheet.Cells(N1 + 4, 1) = "核准人/Setuju : " : xlSheet.Cells(N1 + 4, 4) = "審核人/Peninjau : "
  116. xlSheet.Cells(N1 + 4, 6) = "審核日期/Tanggal_Peninjau : " : xlSheet.Cells(N1 + 5, 4) = "會計/Rekonsiliasi : " : xlSheet.Cells(N1 + 5, 6) = "對帳日期/Tanggal rekonsiliasi : "
  117. xlSheet.Cells(N1 + 6, 4) = "出納/kasir : " : xlSheet.Cells(N1 + 6, 6) = "出納日期/Tanggal kasir : " : xlSheet.Cells(N1 + 7, 6) = "領款人/Penerima : "
  118. xlSheet.Cells(N1 + 4, 5) = DataGridView1.Rows(0).Cells("審核人").Value
  119. xlSheet.Cells(N1 + 4, 8) = DataGridView1.Rows(0).Cells("審核日期").Value
  120. AA(xlApp, xlSheet) : BB(xlApp, xlSheet) : CC(xlApp, xlSheet) : DD(xlApp, xlSheet)
  121. xlSheet.PageSetup.PrintArea = ""
  122. xlApp.Cells.Select()
  123. xlSheet.Range("B1").Select()
  124. xlApp.Application.WindowState = xlMinimized
  125. xlSheet.Cells.Select()
  126. xlApp.ActiveSheet.Protect(DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="0911274990")
  127. xlApp.ActiveSheet.EnableSelection = 1
  128. MsgBox("列印完成。 / Print finish.")
  129. Me.Close()
  130. End Sub
  131. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  132. 列印用SQL = "" : Me.Close()
  133. End Sub
  134. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  135. Return CType(xlBook.Worksheets.Add, Worksheet)
  136. End Function
  137. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  138. xlSheet.Cells.Select()
  139. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False
  140. .Superscript = False
  141. .Subscript = False
  142. .OutlineFont = False
  143. .Shadow = False
  144. .Underline = xlUnderlineStyleNone
  145. .ThemeColor = xlThemeColorLight1
  146. .TintAndShade = 0
  147. .ThemeFont = xlThemeFontNone
  148. End With
  149. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 8
  150. xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 10
  151. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 20
  152. xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 15
  153. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 15
  154. xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 15
  155. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 12
  156. xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 10
  157. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  158. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 35
  159. xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 30
  160. xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 25
  161. xlSheet.Rows("4:" & N2 + 2 & "").Select : myExcel.Selection.RowHeight = 55
  162. xlSheet.Rows("" & N2 + 3 & ":" & N2 + 7 & "").Select : myExcel.Selection.RowHeight = 30
  163. 位置1 = "A3:I" & N2 + 2 : xlSheet.Range(位置1).Select()
  164. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  165. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  166. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  167. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  168. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  169. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  170. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  171. xlSheet.Range("A1:I1").Select() : myExcel.Selection.Merge
  172. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 20 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  173. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  174. xlSheet.Range("A2:I2").Select()
  175. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlBottom : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  176. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  177. myExcel.ActiveWindow.DisplayGridlines = False
  178. 位置1 = "A2:A" & N2 + 4 : xlSheet.Range(位置1).Select()
  179. With myExcel.Selection : .HorizontalAlignment = xlLeft : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  180. .ReadingOrder = xlContext : .MergeCells = False : End With
  181. 位置1 = "D2:D" & N2 + 4 : xlSheet.Range(位置1).Select()
  182. With myExcel.Selection : .HorizontalAlignment = xlLeft : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  183. .ReadingOrder = xlContext : .MergeCells = False : End With
  184. xlSheet.Range("E2").Select()
  185. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlBottom : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  186. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  187. 位置1 = "E" & N2 + 4 : xlSheet.Range(位置1).Select()
  188. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  189. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  190. 位置1 = "G" & N2 + 4 : xlSheet.Range(位置1).Select()
  191. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  192. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  193. 位置1 = "F" & N2 + 4 : xlSheet.Range(位置1).Select()
  194. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  195. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  196. 位置1 = "F" & N2 + 5 : xlSheet.Range(位置1).Select()
  197. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  198. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  199. 位置1 = "F" & N2 + 6 : xlSheet.Range(位置1).Select()
  200. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  201. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  202. 位置1 = "H" & N2 + 4 : xlSheet.Range(位置1).Select()
  203. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  204. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  205. xlSheet.Range("G2").Select()
  206. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  207. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  208. xlSheet.Range("F2").Select()
  209. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  210. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  211. xlSheet.Range("A1:I1").Select()
  212. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  213. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  214. xlSheet.Range("F2:G2").Select()
  215. With myExcel.Selection : .VerticalAlignment = xlBottom : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  216. .ReadingOrder = xlContext : .MergeCells = False : End With
  217. xlSheet.Columns("F:F").Select
  218. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlBottom : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  219. .ReadingOrder = xlContext : .MergeCells = False : End With
  220. xlSheet.Range("A1:I1").Select() : myExcel.Selection.Merge
  221. 位置1 = "E4:E" & N2 + 4 : xlSheet.Range(位置1).Select()
  222. myExcel.Selection.NumberFormatLocal = "#,##0"
  223. With myExcel.Selection : .HorizontalAlignment = xlRight : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  224. .ReadingOrder = xlContext : .MergeCells = False : End With
  225. For I As Integer = 4 To N2
  226. xlSheet.Range("B" & I & ":D" & I).Select() : myExcel.Selection.Merge
  227. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  228. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  229. xlSheet.Range("F" & I & ":I" & I).Select() : myExcel.Selection.Merge
  230. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  231. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  232. Next
  233. End Sub
  234. Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  235. Clipboard.SetDataObject(PictureBox1.Image)
  236. 位置1 = "B" & N2 + 5 : xlSheet.Range(位置1).Select()
  237. myExcel.ActiveSheet.Pictures.Paste.Select
  238. myExcel.Selection.ShapeRange.Height = 43
  239. End Sub
  240. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  241. myExcel.Application.PrintCommunication = False
  242. With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  243. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  244. With myExcel.ActiveSheet.PageSetup
  245. .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
  246. .LeftMargin = myExcel.Application.InchesToPoints(0.25) : .RightMargin = myExcel.Application.InchesToPoints(0.25) : .TopMargin = myExcel.Application.InchesToPoints(0.75)
  247. .BottomMargin = myExcel.Application.InchesToPoints(0.75) : .HeaderMargin = myExcel.Application.InchesToPoints(0.3) : .FooterMargin = myExcel.Application.InchesToPoints(0.3)
  248. .PrintHeadings = False : .PrintGridlines = False : .PrintQuality = 600 : .CenterHorizontally = True : .CenterVertically = False : .Draft = False : .FirstPageNumber = xlAutomatic
  249. .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = 1 : .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False
  250. .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  251. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = ""
  252. .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = "" : .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = ""
  253. .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  254. End With
  255. End Sub
  256. Private Sub DD(ByVal myExcel As Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  257. Clipboard.SetDataObject(PictureBox2.Image)
  258. 位置1 = "C" & N1 + 3 : xlSheet.Range(位置1).Select()
  259. myExcel.ActiveSheet.Pictures.Paste.Select
  260. myExcel.Selection.ShapeRange.Height = 45
  261. myExcel.Selection.ShapeRange.IncrementLeft(1)
  262. myExcel.Selection.ShapeRange.IncrementTop(3)
  263. End Sub
  264. End Class