暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

附錄合約.vb 41KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. Option Strict Off
  2. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  3. Imports Microsoft.Office.Interop.Excel.Constants
  4. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  5. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  6. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  7. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  8. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  9. Imports Microsoft.Office.Interop.Excel.XlWindowState
  10. Imports Microsoft.Office.Interop.Excel
  11. Public Class 附錄合約
  12. ReadOnly ds8 As New DataSet
  13. Dim 放大 As Boolean
  14. Dim ESTR As String
  15. Dim EDR As Integer = 0
  16. Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
  17. ReadOnly 對話框(7) As String
  18. Private Sub Set_合約清單()
  19. Dim ds6 As New DataSet
  20. 合約_dgv.DataSource = Nothing : ds6.Clear()
  21. 合約_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  22. 合約_dgv.ColumnHeadersHeight = 25 : 合約_dgv.AllowUserToAddRows = False
  23. PA46 = 合約編號1_cb.Text : PA47 = 工程期1_ch.Text
  24. SQL_合約清單()
  25. da.Fill(ds6) : 合約_dgv.DataSource = ds6.Tables(0) : conn.Close()
  26. 合約_dgv.Columns(0).FillWeight = 160 : 合約_dgv.Columns(1).Visible = False : 合約_dgv.Columns(2).Visible = False : 合約_dgv.Columns(3).Visible = False
  27. 合約_dgv.Columns(4).Visible = False : 合約_dgv.Columns(5).Visible = False : 合約_dgv.Columns(6).Visible = False : 合約_dgv.Columns(7).Visible = False
  28. 合約_dgv.Columns(8).Visible = False : 合約_dgv.Columns(9).Visible = False : 合約_dgv.Columns(10).Visible = False : 合約_dgv.Columns(11).Visible = False
  29. 合約_dgv.Columns(12).Visible = False : 合約_dgv.Columns(13).Visible = False : 合約_dgv.Columns(14).Visible = False : 合約_dgv.Columns(15).Visible = False
  30. 合約_dgv.Columns(16).Visible = False : 合約_dgv.Columns(17).Visible = False : 合約_dgv.Columns(18).Visible = False : 合約_dgv.Columns(19).Visible = False
  31. 合約_dgv.Columns(20).Visible = False : 合約_dgv.Columns(21).Visible = False : 合約_dgv.Columns(22).Visible = False : 合約_dgv.Columns(23).Visible = False
  32. 合約_dgv.Columns(24).FillWeight = 100 : 合約_dgv.Columns(25).Visible = False : 合約_dgv.Columns(26).Visible = False : 合約_dgv.Columns(27).Visible = False
  33. 合約_dgv.Columns(28).Visible = False : 合約_dgv.Columns("工程").FillWeight = 300 : 合約_dgv.Columns("Project").FillWeight = 300
  34. If 系統語言 = "繁體中文" Then
  35. If 放大 = True Then : 合約_dgv.Columns("工程").Visible = True : Else : 合約_dgv.Columns("工程").Visible = False : End If
  36. Else
  37. If 放大 = True Then : 合約_dgv.Columns("Project").Visible = True : Else : 合約_dgv.Columns("Project").Visible = False : End If
  38. End If
  39. End Sub
  40. Private Sub Set_附錄清單()
  41. Dim ds1 As New DataSet
  42. 合約附錄_dgv.DataSource = Nothing : ds1.Clear()
  43. 合約附錄_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  44. 合約附錄_dgv.ColumnHeadersHeight = 25 : 合約附錄_dgv.AllowUserToAddRows = False
  45. SQL_附錄合約_清單查詢()
  46. da.Fill(ds1) : 合約附錄_dgv.DataSource = ds1.Tables(0) : conn.Close()
  47. 合約附錄_dgv.Columns(0).Visible = False : 合約附錄_dgv.Columns(1).FillWeight = 160 : 合約附錄_dgv.Columns(2).Visible = False : 合約附錄_dgv.Columns(3).Visible = False
  48. 合約附錄_dgv.Columns(4).Visible = False : 合約附錄_dgv.Columns(5).Visible = False : 合約附錄_dgv.Columns(6).Visible = False : 合約附錄_dgv.Columns(7).FillWeight = 70
  49. End Sub
  50. Private Sub 甲方條件下拉清單讀取()
  51. SQL合約條件讀取() : 合約編號1_cb.Items.Clear() : 合約編號1_cb.Items.Add("") : While (dr.Read()) : 合約編號1_cb.Items.Add(dr("約號甲方")) : End While : conn.Close()
  52. End Sub
  53. Private Sub Set_語言()
  54. 語言_dgv.DataSource = Nothing : ds8.Clear()
  55. 語言_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  56. 語言_dgv.ColumnHeadersHeight = 25
  57. 語言_dgv.AllowUserToAddRows = False
  58. SQL_系統語言導入()
  59. da.Fill(ds8) : 語言_dgv.DataSource = ds8.Tables(0) : conn.Close()
  60. End Sub
  61. Private Sub 語言轉換讀取()
  62. Set_語言() : conn.Close()
  63. For i As Integer = 0 To 語言_dgv.Rows.Count - 1
  64. If 語言_dgv("控件", i).Value.ToString = "附錄合約" Then : Me.Text = 語言_dgv("內容", i).Value.ToString : End If
  65. If 語言_dgv("控件", i).Value.ToString = "甲方_lb" Then : 甲方_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  66. If 語言_dgv("控件", i).Value.ToString = "搜尋_lb" Then : 搜尋_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  67. If 語言_dgv("控件", i).Value.ToString = "不列印金額_ch" Then : 不列印金額_ch.Text = 語言_dgv("內容", i).Value.ToString : End If
  68. If 語言_dgv("控件", i).Value.ToString = "附錄編號_lb" Then : 附錄編號_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  69. If 語言_dgv("控件", i).Value.ToString = "合約編號_lb" Then : 合約編號_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  70. If 語言_dgv("控件", i).Value.ToString = "立約日期_lb" Then : 立約日期_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  71. If 語言_dgv("控件", i).Value.ToString = "工程名稱_中_lb" Then : 工程名稱_中_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  72. If 語言_dgv("控件", i).Value.ToString = "工程名稱_英_lb" Then : 工程名稱_英_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  73. If 語言_dgv("控件", i).Value.ToString = "客戶名稱_lb" Then : 客戶名稱_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  74. If 語言_dgv("控件", i).Value.ToString = "合約附錄停用_ch" Then : 合約附錄停用_ch.Text = 語言_dgv("內容", i).Value.ToString : End If
  75. If 語言_dgv("控件", i).Value.ToString = "原合约金额_lb" Then : 原合约金额_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  76. If 語言_dgv("控件", i).Value.ToString = "追加减_lb" Then : 追加减_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  77. If 語言_dgv("控件", i).Value.ToString = "總金額_lb" Then : 總金額_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  78. If 語言_dgv("控件", i).Value.ToString = "其他內容_lb" Then : 其他內容_lb.Text = 語言_dgv("內容", i).Value.ToString : End If
  79. If 語言_dgv("控件", i).Value.ToString = "dgv_合約號" Then : 表頭(134) = 語言_dgv("內容", i).Value.ToString : End If
  80. If 語言_dgv("控件", i).Value.ToString = "dgv_立約日期" Then : 表頭(116) = 語言_dgv("內容", i).Value.ToString : End If
  81. If 語言_dgv("控件", i).Value.ToString = "dgv_附錄編號" Then : 表頭(99) = 語言_dgv("內容", i).Value.ToString : End If
  82. If 語言_dgv("控件", i).Value.ToString = "dgv_保固到期" Then : 表頭(179) = 語言_dgv("內容", i).Value.ToString : End If
  83. If 語言_dgv("控件", i).Value.ToString = "對話框1" Then : 對話框(0) = 語言_dgv("內容", i).Value.ToString : End If
  84. If 語言_dgv("控件", i).Value.ToString = "對話框2" Then : 對話框(1) = 語言_dgv("內容", i).Value.ToString : End If
  85. If 語言_dgv("控件", i).Value.ToString = "對話框3" Then : 對話框(2) = 語言_dgv("內容", i).Value.ToString : End If
  86. If 語言_dgv("控件", i).Value.ToString = "對話框4" Then : 對話框(3) = 語言_dgv("內容", i).Value.ToString : End If
  87. If 語言_dgv("控件", i).Value.ToString = "對話框5" Then : 對話框(4) = 語言_dgv("內容", i).Value.ToString : End If
  88. If 語言_dgv("控件", i).Value.ToString = "對話框6" Then : 對話框(5) = 語言_dgv("內容", i).Value.ToString : End If
  89. If 語言_dgv("控件", i).Value.ToString = "對話框7" Then : 對話框(6) = 語言_dgv("內容", i).Value.ToString : End If
  90. If 語言_dgv("控件", i).Value.ToString = "對話框8" Then : 對話框(7) = 語言_dgv("內容", i).Value.ToString : End If
  91. Next
  92. End Sub
  93. Private Sub 附錄合約_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  94. H(104) = True : 介面 = "H104" : 語言轉換讀取()
  95. 甲方條件下拉清單讀取() : Set_合約清單() : Set_附錄清單() : 合約報價單_Siz()
  96. End Sub
  97. Private Sub 合約報價單_Siz()
  98. MyModule1.清單字體大小調整()
  99. 合約_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", GCM_ERP_SYS.字體_NUD.Value)
  100. 合約附錄_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", GCM_ERP_SYS.字體_NUD.Value)
  101. End Sub
  102. Private Sub 附錄合約_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  103. H(104) = False
  104. End Sub
  105. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  106. 介面 = "H104" : 語言轉換讀取() : Set_合約清單() : Set_附錄清單()
  107. End Sub
  108. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  109. timeNow = 0 : GCM_ERP_SYS.Timer1.Enabled = False : GCM_ERP_SYS.Timer1.Enabled = True
  110. End Sub
  111. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  112. timeNow = 0 : GCM_ERP_SYS.Timer1.Enabled = False : GCM_ERP_SYS.Timer1.Enabled = True
  113. End Sub
  114. Private Sub 合約_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約_dgv.CellClick
  115. If e.RowIndex = -1 Then : Else
  116. 客戶名稱_tb.Text = 合約_dgv("客戶名稱", e.RowIndex).Value.ToString : 合約編號_tb.Text = 合約_dgv(表頭(134), e.RowIndex).Value.ToString
  117. 工程名稱_中_tb.Text = 合約_dgv("工程", e.RowIndex).Value.ToString : 工程名稱_英_tb.Text = 合約_dgv("Project", e.RowIndex).Value.ToString
  118. NUD3.Value = 合約_dgv("工程總價", e.RowIndex).Value : NUD2.Value = 0 : 其他內容_tb.Text = ""
  119. PA = 合約編號_tb.Text : Set_附錄清單() : If 放大 = True Then : 縮放2_bt.PerformClick() : End If
  120. End If
  121. End Sub
  122. Private Sub 合約附錄_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約附錄_dgv.CellClick
  123. NUD3.Value = 合約附錄_dgv("原金額", e.RowIndex).Value : NUD2.Value = 合約附錄_dgv("追加減", e.RowIndex).Value
  124. 附錄編號_tb.Text = 合約附錄_dgv(表頭(99), e.RowIndex).Value.ToString : 其他內容_tb.Text = 合約附錄_dgv("其他內容", e.RowIndex).Value.ToString
  125. 合約附錄停用_ch.Checked = 合約附錄_dgv(表頭(179), e.RowIndex).Value
  126. End Sub
  127. Private Sub 合約編號1_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 合約編號1_cb.SelectedIndexChanged
  128. Set_合約清單()
  129. End Sub
  130. Private Sub 工程期1_ch_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 工程期1_ch.SelectedIndexChanged
  131. Set_合約清單()
  132. End Sub
  133. Private Sub NUD3_ValueChanged(sender As Object, e As EventArgs) Handles NUD3.ValueChanged
  134. NUD1.Value = NUD3.Value + NUD2.Value
  135. End Sub
  136. Private Sub NUD2_ValueChanged(sender As Object, e As EventArgs) Handles NUD2.ValueChanged
  137. NUD1.Value = NUD3.Value + NUD2.Value
  138. End Sub
  139. Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
  140. PA = 關鍵字搜尋_tb.Text : Set_合約清單()
  141. End Sub
  142. Private Sub 新增資料_bt_Click(sender As Object, e As EventArgs) Handles 新增資料_bt.Click
  143. If 合約編號_tb.Text = "" Then : MsgBox(對話框(0)) : Else
  144. SQL_附錄合約_最後一筆資料()
  145. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("附錄編號").ToString, 9)) : Else : EDR = 0 : End If
  146. conn.Close() : EDR += 1
  147. If EDR < 10 Then : ESTR = "HP" & "00000000" & EDR
  148. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "HP" & "0000000" & EDR
  149. ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "HP" & "000000" & EDR
  150. ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "HP" & "00000" & EDR
  151. ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "HP" & "0000" & EDR
  152. ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "HP" & "000" & EDR
  153. ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "HP" & "00" & EDR
  154. ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "HP" & "0" & EDR
  155. ElseIf EDR > 99999999 Then : ESTR = "HP" & EDR : End If
  156. 附錄編號_tb.Text = ESTR : NUD2.Value = 0 : 其他內容_tb.Text = ""
  157. End If
  158. End Sub
  159. Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
  160. If 合約編號_tb.Text = "" Then : MsgBox(對話框(0)) : Else
  161. If 附錄編號_tb.Text = "" Then : MsgBox(對話框(1)) : Else
  162. PA1 = 附錄編號_tb.Text : SQL_附錄合約_刪除() : Set_附錄清單() : MsgBox(對話框(2))
  163. End If
  164. End If
  165. End Sub
  166. Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
  167. If 合約編號_tb.Text = "" Then : MsgBox(對話框(0)) : Else
  168. If 附錄編號_tb.Text = "" Then : MsgBox(對話框(1)) : Else
  169. PA = 合約編號_tb.Text : PA1 = 附錄編號_tb.Text : PA2 = Strings.Format(立約日期_dtp.Value, "yyyy/MM/dd") : PA3 = NUD3.Value : PA4 = NUD2.Value
  170. PA5 = NUD1.Value : PA6 = 其他內容_tb.Text : BL1 = 合約附錄停用_ch.Checked
  171. SQL_附錄合約_最後一筆資料1() : If dr.Read() Then : SQL_附錄合約_修改() : Else : SQL_附錄合約_新增() : End If : Set_附錄清單() : MsgBox(對話框(3))
  172. End If
  173. End If
  174. End Sub
  175. Private Sub 縮放2_bt_Click(sender As Object, e As EventArgs) Handles 縮放2_bt.Click
  176. Dim NX, NY As Integer : NX = 合約_dgv.Size.Width : NY = 合約_dgv.Size.Height
  177. If 放大 = True Then
  178. 合約_dgv.Size = New System.Drawing.Point(NX - 400, NY) : 放大 = False
  179. If 系統語言 = "繁體中文" Then
  180. 合約_dgv.Columns("工程").Visible = False
  181. Else
  182. 合約_dgv.Columns("Project").Visible = False
  183. End If
  184. Else
  185. 合約_dgv.Size = New System.Drawing.Point(NX + 400, NY) : 放大 = True
  186. If 系統語言 = "繁體中文" Then
  187. 合約_dgv.Columns("工程").Visible = True
  188. Else
  189. 合約_dgv.Columns("Project").Visible = False
  190. End If
  191. End If
  192. End Sub
  193. Private Sub 列印_bt_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
  194. If 合約編號_tb.Text = "" Then : MsgBox(對話框(4)) : Else
  195. If 附錄編號_tb.Text = "" Then : MsgBox(對話框(5)) : Else
  196. If 合約附錄停用_ch.Checked = True Then : MsgBox(對話框(6)) : Else
  197. xlApp = CType(CreateObject("Excel.Application"), Application)
  198. xlApp.Visible = True
  199. xlApp.DisplayAlerts = True
  200. xlApp.Application.WindowState = xlMaximized
  201. xlBook = xlApp.Workbooks.Add
  202. '----------------------------------------------------------------------------------------------------------------------
  203. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "合約附錄"
  204. xlBook.Activate() : xlSheet.Activate()
  205. xlSheet.Cells(2, 1) = "附錄合約" : xlSheet.Cells(3, 1) = "Appendix contract" : xlSheet.Cells(4, 1) = "編號(No) : " & 合約編號_tb.Text
  206. xlSheet.Cells(5, 1) = 工程名稱_中_tb.Text : xlSheet.Cells(6, 1) = 工程名稱_英_tb.Text
  207. xlSheet.Cells(7, 1) = "日期(Date) : " & Strings.Format(立約日期_dtp.Value, "yyyy/MM/dd")
  208. Dim BF As String
  209. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : BF = "PT HONG XHE INDUSTRIAL" : Else : BF = "PT PUNCAK GEMILANG SEMESTA"
  210. End If
  211. xlSheet.Cells(8, 1) = "根據 " & 合約編號_tb.Text & " 號合同,雙方為A方 " & 客戶名稱_tb.Text & " 和B方 " & BF
  212. xlSheet.Cells(9, 1) = "According to the contract of " & 合約編號_tb.Text & ", both parties are " & 客戶名稱_tb.Text & " of Party A and " & BF
  213. If 不列印金額_ch.Checked = False Then
  214. xlSheet.Cells(11, 1) = "雙方同意此 " & 合約編號_tb.Text & " 號合同工程款变更为:"
  215. xlSheet.Cells(12, 1) = "The parties agree that the contract amount of this " & 合約編號_tb.Text & " will be changed to: "
  216. xlSheet.Cells(13, 1) = "1、原合约金额(含税) :" & Strings.Format(NUD3.Value, "#,##0") & " RP"
  217. xlSheet.Cells(14, 1) = " Original contract amount (including tax): " & Strings.Format(NUD3.Value, "#,##0") & " RP"
  218. xlSheet.Cells(16, 1) = "2、追加/追减金额(含税) :" & Strings.Format(NUD2.Value, "#,##0") & " RP"
  219. xlSheet.Cells(17, 1) = " Additional/reduction amount (including tax): " & Strings.Format(NUD2.Value, "#,##0") & " RP"
  220. xlSheet.Cells(19, 1) = "3、结算总金額(含税) : " & Strings.Format(NUD1.Value, "#,##0") & " RP"
  221. xlSheet.Cells(20, 1) = " Total settlement amount (including tax): " & Strings.Format(NUD1.Value, "#,##0") & " RP"
  222. xlSheet.Cells(22, 1) = 其他內容_tb.Text
  223. xlSheet.Cells(24, 1) = "此份附錄合同立成02份(中,英文版),A方執01份、B方執01份,在法律上均具同時等價值。 "
  224. xlSheet.Cells(25, 1) = "This appendix has a contract of 02 copies (in Chinese and English), with A party holding 01 copies and Party B holding 01 copies, which are legally equivalent"
  225. xlSheet.Cells(27, 1) = "Party A (A方)" : xlSheet.Cells(27, 3) = "Party B (B方)"
  226. Else
  227. xlSheet.Cells(11, 1) = 其他內容_tb.Text
  228. xlSheet.Cells(13, 1) = "此份附錄合同立成02份(中,英文版),A方執01份、B方執01份,在法律上均具同時等價值。 "
  229. xlSheet.Cells(14, 1) = "This appendix has a contract of 02 copies (in Chinese and English), with A party holding 01 copies and Party B holding 01 copies, which are legally equivalent"
  230. xlSheet.Cells(16, 1) = "Party A (A方)" : xlSheet.Cells(27, 3) = "Party B (B方)"
  231. End If
  232. AA(xlApp, xlSheet)
  233. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  234. xlApp.Sheets(2).Delete
  235. xlSheet.PageSetup.PrintArea = ""
  236. xlApp.Cells.Select()
  237. xlApp.Application.WindowState = xlMinimized
  238. MsgBox(對話框(7))
  239. End If
  240. End If
  241. End If
  242. End Sub
  243. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  244. Return CType(xlBook.Worksheets.Add, Worksheet)
  245. End Function
  246. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  247. xlSheet.Cells.Select()
  248. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  249. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  250. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95
  251. xlSheet.Columns("A:C").Select : myExcel.Selection.ColumnWidth = 40
  252. xlSheet.Range("A2:C2").Select()
  253. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  254. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  255. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  256. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  257. xlSheet.Range("A3:C3").Select()
  258. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  259. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  260. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  261. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  262. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  263. xlSheet.Range("A4:C4").Select()
  264. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  265. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  266. xlSheet.Range("A5:C5").Select()
  267. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  268. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  269. xlSheet.Range("A6:C6").Select()
  270. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  271. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  272. xlSheet.Range("A7:C7").Select()
  273. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  274. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  275. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  276. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  277. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  278. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  279. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  280. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  281. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  282. xlSheet.Range("A8:C8").Select()
  283. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  284. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  285. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  286. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  287. xlSheet.Rows("8:8").Select : myExcel.Selection.RowHeight = 45
  288. xlSheet.Range("A9:C9").Select()
  289. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  290. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  291. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  292. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  293. xlSheet.Rows("9:9").Select : myExcel.Selection.RowHeight = 45
  294. If 不列印金額_ch.Checked = False Then
  295. xlSheet.Range("A11:C11").Select()
  296. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  297. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  298. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  299. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  300. xlSheet.Rows("11:11").Select : myExcel.Selection.RowHeight = 15.75
  301. xlSheet.Range("A12:C12").Select()
  302. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  303. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  304. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  305. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  306. xlSheet.Rows("12:12").Select : myExcel.Selection.RowHeight = 15.75
  307. xlSheet.Range("A13:C13").Select()
  308. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  309. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  310. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  311. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  312. xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 15.75
  313. xlSheet.Range("A14:C14").Select()
  314. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  315. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  316. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  317. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  318. xlSheet.Rows("14:14").Select : myExcel.Selection.RowHeight = 15.75
  319. xlSheet.Range("A16:C16").Select()
  320. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  321. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  322. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  323. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  324. xlSheet.Rows("16:16").Select : myExcel.Selection.RowHeight = 15.75
  325. xlSheet.Range("A17:C17").Select()
  326. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  327. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  328. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  329. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  330. xlSheet.Rows("17:17").Select : myExcel.Selection.RowHeight = 15.75
  331. xlSheet.Range("A19:C19").Select()
  332. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  333. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  334. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  335. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  336. xlSheet.Rows("19:19").Select : myExcel.Selection.RowHeight = 15.75
  337. xlSheet.Range("A20:C20").Select()
  338. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  339. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  340. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  341. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  342. xlSheet.Rows("20:20").Select : myExcel.Selection.RowHeight = 15.75
  343. xlSheet.Range("A22:C22").Select()
  344. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  345. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  346. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  347. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  348. xlSheet.Rows("22:22").Select : myExcel.Selection.RowHeight = 250
  349. xlSheet.Range("A24:C24").Select()
  350. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  351. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  352. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  353. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  354. xlSheet.Rows("24:24").Select : myExcel.Selection.RowHeight = 15.75
  355. xlSheet.Range("A25:C25").Select()
  356. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  357. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  358. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  359. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  360. xlSheet.Rows("25:25").Select : myExcel.Selection.RowHeight = 35
  361. xlSheet.Range("A27:C27").Select()
  362. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  363. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  364. xlSheet.Rows("28:28").Select : myExcel.Selection.RowHeight = 90
  365. xlSheet.Range("A28").Select()
  366. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  367. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  368. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  369. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  370. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  371. xlSheet.Range("C28").Select()
  372. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  373. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  374. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  375. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  376. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  377. xlSheet.Rows("10:10").Select : myExcel.Selection.RowHeight = 8 : xlSheet.Rows("15:15").Select : myExcel.Selection.RowHeight = 8
  378. xlSheet.Rows("18:18").Select : myExcel.Selection.RowHeight = 8 : xlSheet.Rows("21:21").Select : myExcel.Selection.RowHeight = 8
  379. Else
  380. xlSheet.Range("A11:C11").Select()
  381. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  382. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  383. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  384. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  385. xlSheet.Rows("11:11").Select : myExcel.Selection.RowHeight = 400
  386. xlSheet.Range("A13:C13").Select()
  387. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  388. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  389. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  390. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  391. xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 15.75
  392. xlSheet.Range("A14:C14").Select()
  393. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  394. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  395. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  396. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  397. xlSheet.Rows("14:14").Select : myExcel.Selection.RowHeight = 35
  398. xlSheet.Range("A16:C16").Select()
  399. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  400. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  401. xlSheet.Rows("17:17").Select : myExcel.Selection.RowHeight = 90
  402. xlSheet.Range("A17").Select()
  403. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  404. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  405. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  406. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  407. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  408. xlSheet.Range("C17").Select()
  409. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  410. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  411. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  412. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  413. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  414. End If
  415. myExcel.ActiveWindow.DisplayGridlines = False
  416. xlSheet.Range("D1").Select()
  417. End Sub
  418. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  419. Clipboard.SetDataObject(PictureBox1.Image)
  420. xlSheet.Range("A1").Select()
  421. myExcel.ActiveSheet.Pictures.Paste.Select
  422. myExcel.Selection.ShapeRange.Height = 93
  423. myExcel.Selection.ShapeRange.IncrementLeft(0)
  424. myExcel.Selection.ShapeRange.IncrementTop(0)
  425. End Sub
  426. Private Sub DD(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  427. Clipboard.SetDataObject(PictureBox2.Image)
  428. xlSheet.Range("A1").Select()
  429. myExcel.ActiveSheet.Pictures.Paste.Select
  430. myExcel.Selection.ShapeRange.Height = 93
  431. myExcel.Selection.ShapeRange.IncrementLeft(0)
  432. myExcel.Selection.ShapeRange.IncrementTop(0)
  433. End Sub
  434. Private Sub FF(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  435. myExcel.Application.PrintCommunication = False : With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  436. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  437. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "第 &P 頁,共 &N 頁" : .RightFooter = ""
  438. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  439. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  440. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  441. .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = True : .CenterVertically = False : .Draft = False
  442. .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False : .OddAndEvenPagesHeaderFooter = False
  443. .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  444. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = ""
  445. .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  446. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  447. End With : myExcel.Application.PrintCommunication = True
  448. End Sub
  449. End Class