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://fushidao.cc/wangzhanyunying/13784.html
您可能感兴趣的文章
- 05-12怎么激活office016,office2016激活密钥
- 05-12怎么查询office激活时间,office激活时间怎么查
- 05-12怎么激活电脑自带office,电脑自带office如何激活
- 05-12office许可掉了怎么激活,office密钥激活失败怎么办
- 05-12正版office怎么算激活,office正版激活方法
- 05-12平板office怎么免费激活,office免费激活方法
- 05-12怎么去重新激活office,office激活失败怎么办
- 05-12kms怎么取消激活office,office激活失败怎么办
- 05-12新电脑怎么office激活?office激活失败怎么办
- 05-12office2020怎么激活?office2020激活失败怎么办
阅读排行
- 1怎么激活office016,office2016激活密钥
- 2怎么查询office激活时间,office激活时间怎么查
- 3怎么激活电脑自带office,电脑自带office如何激活
- 4office许可掉了怎么激活,office密钥激活失败怎么办
- 5正版office怎么算激活,office正版激活方法
- 6平板office怎么免费激活,office免费激活方法
- 7怎么去重新激活office,office激活失败怎么办
- 8kms怎么取消激活office,office激活失败怎么办
- 9新电脑怎么office激活?office激活失败怎么办
- 10office2020怎么激活?office2020激活失败怎么办
推荐教程
- 07-012025最新office2010永久激活码免费分享,附office 2010激活工具
- 07-092025年最新office365激活码 office365永久激活密钥key分享
- 07-01怎么免费获取2025最新office2016专业增强版永久激活密钥/序列号
- 11-30正版office2021永久激活密钥
- 07-30Office2019 产品激活密钥(100%永久激活)
- 11-25怎么激活office2019最新版?office 2019激活秘钥+激活工具推荐
- 07-052025最新Office2019激活密钥,Office2019产品密钥分享
- 11-22office怎么免费永久激活 office产品密钥永久激活码
- 06-25office2021年最新永久有效正版激活密钥免费分享
- 11-25office2010 产品密钥 永久密钥最新分享
