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://www.fushidao.cc/wangzhanyunying/13784.html
您可能感兴趣的文章
- 11-28Office365激活码怎么激活?正版激活码哪里买
- 11-28Office激活密钥怎么用?Office激活密钥永久有效吗
- 11-28office2016激活密钥怎么激活,永久密钥哪里找?
- 11-28Office2010激活码怎么永久激活,Office2010激活码免费获取方法
- 11-27Office怎么激活,Office激活密钥和激活工具怎么用
- 11-27Office激活工具怎么用,office激活工具哪个安全好用?
- 11-26Office激活失败怎么办,Office激活密钥怎么用
- 07-12免费安装激活Office教程详解,如何零成本获得正版办公软件?,office正版激活教程
- 07-12如何准确查询Office软件的激活有效期及具体激活日期?office软件激活时间怎么查
- 07-12非自带Office系统如何合法激活并使用?详细步骤揭秘!Office正版激活教程
阅读排行
- 1Office365激活码怎么激活?正版激活码哪里买
- 2Office激活密钥怎么用?Office激活密钥永久有效吗
- 3office2016激活密钥怎么激活,永久密钥哪里找?
- 4Office2010激活码怎么永久激活,Office2010激活码免费获取方法
- 5Office怎么激活,Office激活密钥和激活工具怎么用
- 6Office激活工具怎么用,office激活工具哪个安全好用?
- 7Office激活失败怎么办,Office激活密钥怎么用
- 8免费安装激活Office教程详解,如何零成本获得正版办公软件?,office正版激活教程
- 9如何准确查询Office软件的激活有效期及具体激活日期?office软件激活时间怎么查
- 10非自带Office系统如何合法激活并使用?详细步骤揭秘!Office正版激活教程
推荐教程
- 07-012025最新office2010永久激活码免费分享,附office 2010激活工具
- 07-092025年最新office365激活码 office365永久激活密钥key分享
- 07-01怎么免费获取2025最新office2016专业增强版永久激活密钥/序列号
- 06-25office2021年最新永久有效正版激活密钥免费分享
- 11-30正版office2021永久激活密钥
- 07-30Office2019 产品激活密钥(100%永久激活)
- 07-052025最新Office2019激活密钥,Office2019产品密钥分享
- 11-25怎么激活office2019最新版?office 2019激活秘钥+激活工具推荐
- 11-22office怎么免费永久激活 office产品密钥永久激活码
- 07-25office专业增强版2021永久激活密钥(附激活教程)
