Format Word Doc for Access Data
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 228   1
URL.หัวข้อ / URL
Format Word Doc for Access Data

ถามไว้ที่ http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_2000&Number=152050&page=0&view=collapsed&sb=5&o=7&fpart=1&vc=1&PHPSESSID= 
 
เขาต้องการที่จะเข้าไปเปลี่ยน Page Setup และ Margins ของไฟล์ Word  
 
ผมเลยให้ฟังก์ชันนี้กับเขาไป 
 
Function FormatWord(strFileName As String) 
 
Dim objWord As Object 
 
Set objWord = CreateObject("Word.Application") 
 
objWord.Documents.Open FileName:=strFileName 
With objWord.ActiveDocument.PageSetup 
    .Orientation = 1 'wdOrientLandscape 
    .TopMargin = 72 * 1.5 ' 1 inch = 72 points 
    .BottomMargin = 72 * 1.5 
    .LeftMargin = 72 * 2 
    .RightMargin = 72 * 1.5 
End With 
objWord.ActiveDocument.Close savechanges:=&HFFFFFFFF 'wdSaveChanges 
objWord.Quit 
 
Set objWord = Nothing 
 
End Function 
 
จะเห็นว่าการตั้งกันหน้ากันหลังของ Word จะกำหนดเป็น Point จึงต้องแปลงจากนิ้วให้เป็น Point ก่อน 
 
1 นิ้ว = 72 points 
1 ซ.ม. = 28.34646 points 
 

1 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R06640
   
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0585s