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
您可能感兴趣的文章
- 06-25office2021永久免费激活方法
- 06-25office专业增强版2021激活密钥2023密钥永久激活 万能office2021密钥25位
- 06-25office2021年最新永久有效正版激活密钥免费分享
- 06-25最新office2021/2020激活密钥怎么获取 office激活码分享 附激活工具
- 06-25office激活密钥2021家庭版
- 06-25Office2021激活密钥永久最新分享
- 06-24Word中进行分栏文档设置的操作方法
- 06-24Word中进行文档设置图片形状格式的操作方法
- 06-24Word中2010版进行生成目录的操作方法
- 06-24word2007中设置各个页面页眉为不同样式的操作方法


阅读排行
推荐教程
- 11-30正版office2021永久激活密钥
- 11-25怎么激活office2019最新版?office 2019激活秘钥+激活工具推荐
- 11-22office怎么免费永久激活 office产品密钥永久激活码
- 11-25office2010 产品密钥 永久密钥最新分享
- 11-22Office2016激活密钥专业增强版(神Key)Office2016永久激活密钥[202
- 11-30全新 Office 2013 激活密钥 Office 2013 激活工具推荐
- 11-25正版 office 产品密钥 office 密钥 office2019 永久激活
- 11-22office2020破解版(附永久密钥) 免费完整版
- 11-302023 全新 office 2010 标准版/专业版密钥
- 03-262024最新最新office365激活密钥激活码永久有效