Vba全面修改Word段落属性有效代码
下面的WAPP是事先定义的word文档工程变量。
以下代码为通过VBA代码修改Word段落的缩进、段落间距、行距、分页等。
//段落格式设定
WApp.Selection.ParagraphFormat.LeftIndent = WApp.CentimetersToPoints(float.Parse("0"));//左缩进
WApp.Selection.ParagraphFormat.RightIndent = WApp.CentimetersToPoints(float.Parse("0"));//右缩进
WApp.Selection.ParagraphFormat.SpaceBefore =float.Parse("0");//段前间距
WApp.Selection.ParagraphFormat.SpaceBeforeAuto =0;//
WApp.Selection.ParagraphFormat.SpaceAfter = float.Parse("0");//段后间距
WApp.Selection.ParagraphFormat.SpaceAfterAuto = 0;//
WApp.Selection.ParagraphFormat.LineSpacingRule = Microsoft.Office.Interop.Word.WdLineSpacing.wdLineSpaceSingle;//单倍行距
WApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphJustify;//段落2端对齐
WApp.Selection.ParagraphFormat.WidowControl = 0;//孤行控制
WApp.Selection.ParagraphFormat.KeepWithNext = 0;//与下段同页
WApp.Selection.ParagraphFormat.KeepTogether = 0;//段中不分页
WApp.Selection.ParagraphFormat.PageBreakBefore = 0;//段前分页
WApp.Selection.ParagraphFormat.NoLineNumber = 0;//取消行号
WApp.Selection.ParagraphFormat.Hyphenation = 1;//取消段字
WApp.Selection.ParagraphFormat.FirstLineIndent = WApp.CentimetersToPoints(float.Parse("0"));//首行缩进
WApp.Selection.ParagraphFormat.OutlineLevel = Microsoft.Office.Interop.Word.WdOutlineLevel.wdOutlineLevelBodyText;
WApp.Selection.ParagraphFormat.CharacterUnitLeftIndent = float.Parse("0");
WApp.Selection.ParagraphFormat.CharacterUnitRightIndent = float.Parse("0");
WApp.Selection.ParagraphFormat.CharacterUnitFirstLineIndent = float.Parse("0");
WApp.Selection.ParagraphFormat.LineUnitBefore = float.Parse("0");
WApp.Selection.ParagraphFormat.LineUnitAfter = float.Parse("0");
WApp.Selection.ParagraphFormat.AutoAdjustRightIndent = 1;
WApp.Selection.ParagraphFormat.DisableLineHeightGrid =0;
WApp.Selection.ParagraphFormat.FarEastLineBreakControl =1;
WApp.Selection.ParagraphFormat.WordWrap = 1;
WApp.Selection.ParagraphFormat.HangingPunctuation = 1;
WApp.Selection.ParagraphFormat.HalfWidthPunctuationOnTopOfLine = 0;
WApp.Selection.ParagraphFormat.AddSpaceBetweenFarEastAndAlpha = 1;
WApp.Selection.ParagraphFormat.AddSpaceBetweenFarEastAndDigit = 1;
WApp.Selection.ParagraphFormat.BaseLineAlignment = Microsoft.Office.Interop.Word.WdBaselineAlignment.wdBaselineAlignAuto;
上一篇:#实践笔记#本地配置PHPnow与WordPress运行环境
栏 目:office教程
本文标题:Vba全面修改Word段落属性有效代码
本文地址:https://zz.feitang.co/wangzhanyunying/13784.html
您可能感兴趣的文章
- 11-262010 Office密钥过期怎么办?Office2010产品激活失败的解决方法
- 11-26office2010产品密钥有哪些?最新office2010激活密钥汇总
- 11-26office2007密钥哪里找?office2007永久密钥序列号
- 11-26Office2016怎么安装?Office2016安装激活教程
- 11-26Office2010最新激活密钥有哪些?Office2010激活密钥分享大全
- 11-26求Office2013密钥?2025最新Office2013激活密钥
- 11-26Office2013电话怎么激活?Office2013永久激活方法
- 11-26office2016打开卡顿怎么办?office2016打开缓慢的解决技巧
- 11-26Office 2010中文版怎么转换为英文版?
- 11-26office 2010激活错误代码0X8007000D如何解决?


阅读排行
- 12010 Office密钥过期怎么办?Office2010产品激活失败的解决方法
- 2office2010产品密钥有哪些?最新office2010激活密钥汇总
- 3office2007密钥哪里找?office2007永久密钥序列号
- 4Office2016怎么安装?Office2016安装激活教程
- 5Office2010最新激活密钥有哪些?Office2010激活密钥分享大全
- 6求Office2013密钥?2025最新Office2013激活密钥
- 7Office2013电话怎么激活?Office2013永久激活方法
- 8office2016打开卡顿怎么办?office2016打开缓慢的解决技巧
- 9Office 2010中文版怎么转换为英文版?
- 10office 2010激活错误代码0X8007000D如何解决?
推荐教程
- 07-012025最新office2010永久激活码免费分享,附office 2010激活工具
- 07-01怎么免费获取2025最新office2016专业增强版永久激活密钥/序列号
- 07-01office365怎么永久激活?2025.5最新office,office365序列号推荐
- 06-25office2021年最新永久有效正版激活密钥免费分享
- 06-13Office 2024激活工具,2025年Office2024激活工具及激活密钥分享
- 05-12Microsoft office2019产品激活密钥(100%永久激活)
- 07-01office2021专业增强版2021激活密钥2023密钥永久激活 万能office202
- 06-17经验分享Win11激活密钥怎么获取(win11专业版激活密钥)
- 07-01office 2021激活码/序列号推荐,office2021附激活工具
- 06-25Office2021激活密钥永久最新分享




