爱问知识人 爱问教育 医院库

Word Vba修改页边距、纸张纵向、装定线等的代码

首页

Word Vba修改页边距、纸张纵向、装定线等的代码


        

提交回答
好评回答
  • 2024-04-18 14:30:00
      下面的WAPP是事先定义的word文档工程变量。以下代码为通过VBA代码来页面的页边距、纸张纵向、装定线、页眉页静等。WApp。ActiveDocument。PageSetup。LineNumbering。Active =0;//行编号WApp。
      ActiveDocument。PageSetup。Orientation =Microsoft。Office。Interop。Word。WdOrientation。wdOrientPortrait;//页面方向WApp。ActiveDocument。
      PageSetup。TopMargin =WApp。CentimetersToPoints(float。Parse("2。54"));//上页边距WApp。ActiveDocument。PageSetup。BottomMargin = WApp。
      CentimetersToPoints(float。Parse("2。54"));//下页边距WApp。ActiveDocument。PageSetup。LeftMargin = WApp。CentimetersToPoints(float。
      Parse("3。17"));//左页边距WApp。ActiveDocument。PageSetup。RightMargin = WApp。CentimetersToPoints(float。Parse("3。17"));//右页边距WApp。
      ActiveDocument。PageSetup。Gutter = WApp。CentimetersToPoints(float。Parse("0"));//装订线位置WApp。ActiveDocument。PageSetup。HeaderDistance = WApp。
      CentimetersToPoints(float。Parse("1。5"));//页眉WApp。ActiveDocument。PageSetup。FooterDistance = WApp。CentimetersToPoints(float。
      Parse("1。75"));//页脚WApp。ActiveDocument。PageSetup。PageWidth = WApp。CentimetersToPoints(float。Parse("21"));//纸张宽度WApp。ActiveDocument。
      PageSetup。PageHeight = WApp。CentimetersToPoints(float。Parse("29。7"));//纸张高度WApp。ActiveDocument。PageSetup。FirstPageTray = Microsoft。
      Office。Interop。Word。WdPaperTray。wdPrinterDefaultBin;//纸张来源WApp。ActiveDocument。PageSetup。OtherPagesTray = Microsoft。Office。
      Interop。Word。WdPaperTray。wdPrinterDefaultBin;//纸张来源WApp。ActiveDocument。PageSetup。SectionStart = Microsoft。Office。Interop。
      Word。WdSectionStart。wdSectionNewPage;//节的起始位置:新建页WApp。ActiveDocument。PageSetup。OddAndEvenPagesHeaderFooter = 0;//页眉页脚-奇偶页不同WApp。
      ActiveDocument。PageSetup。DifferentFirstPageHeaderFooter = 0;//页眉页脚-首页不同WApp。ActiveDocument。PageSetup。VerticalAlignment = Microsoft。
      Office。Interop。Word。WdVerticalAlignment。wdAlignVerticalTop;//页面垂直对齐方式WApp。ActiveDocument。PageSetup。SuppressEndnotes =0;//不隐藏尾注WApp。
      ActiveDocument。PageSetup。MirrorMargins = 0;//不设置首页的内外边距WApp。ActiveDocument。PageSetup。TwoPagesOnOne = false;//不双面打印WApp。ActiveDocument。
      PageSetup。BookFoldPrinting =false;//不设置手动双面正面打印WApp。ActiveDocument。PageSetup。BookFoldRevPrinting =false;//不设置手动双面背面打印WApp。
      ActiveDocument。PageSetup。BookFoldPrintingSheets = 1;//打印默认份数WApp。ActiveDocument。PageSetup。GutterPos = Microsoft。Office。Interop。
      Word。WdGutterStyle。wdGutterPosLeft;//装订线位于左侧WApp。ActiveDocument。PageSetup。LinesPage = 40;//默认页行数量WApp。ActiveDocument。PageSetup。
      LayoutMode = Microsoft。Office。Interop。Word。WdLayoutMode。wdLayoutModeLineGrid;//版式模式为“只指定行网格”。

    你***

    2024-04-18 14:30:00

  • 电脑/网络 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):