Buy-Sell Crypto ==> Click here ...

Thống kê điểm chuẩn

Click here for Make money Online

Tham gia kênh Telegram kiếm tiền online ==> Click

Hỏi: Làm sao để Export dữ liệu ra Word mà cấu trúc sắp xếp vẩn giống y như trong Reports?
(Export Report access to word 2010)

Private Sub cmdXuat_Click()

Dim oApp As Object, doc As Object
Dim strDocName As String

Set oApp = CreateObject("Word.Application")
oApp.Visible = True
strDocName = CurrentProject.Path & "\DataMauBH" & "\"
Set doc = oApp.Documents.Add(strDocName)

doc.FormFields("txttenkhachhang").Result = IIf(Me.TenKH.Value <> "", Me.TenKH, ".....")
doc.FormFields("txtdvct").Result = IIf(Me.Text65.Value <> "", Me.Text65, ".....")
doc.FormFields("Text1").Result = [Forms]![F_Banhang]![CTHD]![Text1]
doc.FormFields("Text2").Result = [Forms]![F_Banhang]![CTHD]![Text2]
doc.FormFields("Text3").Result = [Forms]![F_Banhang]![CTHD]![Text3]
doc.FormFields("Text4").Result = [Forms]![F_Banhang]![CTHD]![Text4]
doc.FormFields("Text5").Result = [Forms]![F_Banhang]![CTHD]![Text5]
doc.FormFields("Text6").Result = [Forms]![F_Banhang]![CTHD]![Text6]
doc.FormFields("Text7").Result = [Forms]![F_Banhang]![CTHD]![Text7]

oApp.ActiveDocument.SaveAs Filename:=CurrentProject.Path & "\" & Me.SoHD.Value & ".doc"
Set oApp = Nothing
MsgBox "Xuat data thanh cong"
End Sub

Demo: Tại đây


Tham gia kênh Telegram kiếm tiền điện tử => Click here

Download document
Sell off ==> Click

0 comments Blogger 0 Facebook

Post a Comment


Soi điểm: Buy IDO, Buy Pre sale, Claim Coin, Airdrops, Mining Cloude Coin free ©Email: All Rights Reserved. Powered by >How to best