請問用vf代碼怎樣控制word頁的頁眉頁腳?
uj5u.com熱心網友回復:
在WORD中錄制宏,對照WORD VBA 幫助檔案中相關內容寫出相應的代碼不知道樓主想如何控制頁眉頁腳
uj5u.com熱心網友回復:
with mloword as word.application.documents.add() &&建立新檔案
.activedocument.pagesetup.topmargin=0.50/0.035 &&設定上頁邊距
.activedocument.pagesetup.bottommargin=0.2/0.035 &&設定下頁邊距
.activedocument.pagesetup.leftmargin=0.31/0.035 &&設定左頁邊距
.activedocument.pagesetup.rightmargin=6.5/0.035 &&設定右頁邊距
.activedocument.pagesetup.pagewidth=23.5/0.035 &&設定頁高
.activedocument.pagesetup.pageheight=14/0.035 &&設定頁寬
.activedocument.pagesetup.orientation=0 &&為頁面豎放,2為頁面橫放,改為橫
.activedocument.pagesetup.herderdistance =0.9/0.035 &&設定頁眉
.activedocument.pagesetup.footerdistance =0.75/0.035 &&設定頁腳
運行到頁眉頁腳處出錯,請大師給予幫忙
uj5u.com熱心網友回復:
herderdistance拼寫錯誤
headerdistance
uj5u.com熱心網友回復:
oWord = CREATEOBJECT("Word.Application")WITH oWord
.Documents.Add
.Visible = .T.
WITH .ActiveDocument.PageSetup
.TopMargin = oWord.CentimetersToPoints(1.5) && 厘米轉換為磅
.BottomMargin = oWord.CentimetersToPoints(2.0)
.LeftMargin = oWord.CentimetersToPoints(0.31)
.RightMargin = oWord.CentimetersToPoints(6.5)
.PageWidth = oWord.CentimetersToPoints(23.5)
.PageHeight = oWord.CentimetersToPoints(14)
.Orientation = 1 && 橫向 0 縱向
.HeaderDistance = oWord.CentimetersToPoints(0.9)
.FooterDistance = oWord.CentimetersToPoints(0.75)
ENDWITH
ENDWITH
uj5u.com熱心網友回復:
oWord = CREATEOBJECT("Word.Application")
WITH oWord
.Documents.Add
.Visible = .T.
WITH .ActiveDocument.PageSetup
.TopMargin = oWord.CentimetersToPoints(1.5) && 厘米轉換為磅
.BottomMargin = oWord.CentimetersToPoints(2.0)
.LeftMargin = oWord.CentimetersToPoints(0.31)
.RightMargin = oWord.CentimetersToPoints(6.5)
.PageWidth = oWord.CentimetersToPoints(23.5)
.PageHeight = oWord.CentimetersToPoints(14)
.Orientation = 1 && 橫向 0 縱向
.HeaderDistance = oWord.CentimetersToPoints(0.9)
.FooterDistance = oWord.CentimetersToPoints(0.75)
ENDWITH
ENDWITH
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/79499.html
標籤:VFP
上一篇:“System.InvalidOperationException”型別的未經處理的例外出現在 MySql.Data.dll 中。
