当前位置:网站首页>The JS macro of WPS implements the separation method of picture text in the same paragraph
The JS macro of WPS implements the separation method of picture text in the same paragraph
2022-06-24 08:25:00 【Red fox lattice】
When the picture is at the end of the line of the text , Sometimes it's hard for the human eye to tell . But it is easy to make mistakes when editing the format , Pictures need to be centered , The text needs to be left aligned .
as follows JS The code implements : Picture text separation
let rangShapes = Documents.Item(filepath).Range(startP,endP).InlineShapes;
while(i<=count)
{
rangShapes.Item(i).Select();
if(rangShapes.Item(i).Height >= Selection.Font.Size*2)
{// The height of the picture is greater than twice the height of the text font , Center . Otherwise, it will be judged as the content described in the text .
rangShapes.Item(i).Select();
ActiveW.Selection.MoveLeft(wdCharacter, 2, wdExtend);
if(ActiveW.Selection.Paragraphs.Count == 1)
{// Text and words in the same paragraph , Add carriage return before the picture .
rangShapes.Item(i).Select();
ActiveW.Selection.MoveLeft(wdCharacter, 1, wdMove);
ActiveW.Selection.TypeParagraph();
ActiveW.Selection.Style = " Text ";
}
rangShapes.Item(i).Select();
ActiveW.Selection.ParagraphFormat.CharacterUnitFirstLineIndent = 0;
ActiveW.Selection.ParagraphFormat.FirstLineIndent = 0;
ActiveW.Selection.ParagraphFormat.CharacterUnitLeftIndent = 0;
ActiveW.Selection.ParagraphFormat.LeftIndent = 0;
ActiveW.Selection.ParagraphFormat.CharacterUnitRightIndent = 0;
ActiveW.Selection.ParagraphFormat.RightIndent = 0;
ActiveW.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter;// picture centering
}
i++;
}
边栏推荐
- 11--无重复字符的最长子串
- LabVIEW查找n个元素数组中的质数
- Learning event binding of 3D visualization from scratch
- SQL intra statement operation
- 根据网络上的视频的m3u8文件通过ffmpeg进行合成视频
- Pagoda panel installation php7.2 installation phalcon3.3.2
- Upgrade Mysql to the latest version (mysql8.0.25)
- WPS的JS宏实现图片正文在同一段落的分离方法
- Écouter le réseau d'extension SWIFT (source)
- Pat 1157: school anniversary
猜你喜欢

2021-03-04 comp9021 class 6 notes

Swift foundation features unique to swift

新技术实战,一步步用Activity Results API封装权限申请库

2022 tea artist (intermediate) work license question bank and online simulation examination

Qt导出PDF文件的两种方法

The article takes you to understand the security of Windows operating system and protect your computer from infringement

一文带你了解Windows操作系统安全,保护自己的电脑不受侵害

OC Extension 检测手机是否安装某个App(源码)

Question 3 - MessageBox pop-up box, modify the default background color

Pagoda panel installation php7.2 installation phalcon3.3.2
随机推荐
Review SGI STL secondary space configurator (internal storage pool) | notes for personal use
LabVIEW finds prime numbers in an array of n elements
Installation and use of selenium IDE
Swift extension chainlayout (UI chain layout) (source code)
Phonics
Shader common functions
11-- longest substring without repeated characters
2021-03-16 COMP9021第九节课笔记
Search and recommend those things
2021-03-09 COMP9021第七节课笔记
dhcp、tftp基础
Synthesize video through ffmpeg according to m3u8 file of video on the network
WPS的JS宏实现图片正文在同一段落的分离方法
Swift extension networkutil (network monitoring) (source code)
RCNN、Fast-RCNN、Faster-RCNN介绍
【无标题】
贷款五级分类
All you know is the test pyramid?
蓝桥杯_N 皇后问题
一文带你了解Windows操作系统安全,保护自己的电脑不受侵害