当前位置:网站首页>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++;
}
边栏推荐
- Which is the first poem of Tang Dynasty?
- WPS的JS宏实现图片正文在同一段落的分离方法
- Coordinate transformation of graphic technology
- Unity culling related technologies
- C语言_字符串与指针的爱恨情仇
- Catégorie de prêt 5
- Swift foundation features unique to swift
- Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)
- Synthesize video through ffmpeg according to m3u8 file of video on the network
- Analysis of abnormal problems in domain name resolution in kubernetes
猜你喜欢

Swift Extension ChainLayout(UI的链式布局)(源码)

12--合并两个有序链表

2021-03-16 COMP9021第九节课笔记

Application of JDBC in performance test

Swift Extension NetworkUtil(網絡監聽)(源碼)

5分钟,客服聊天处理技巧,炉火纯青

Question bank and simulation examination for operation certificate of refrigeration and air conditioning equipment in 2022

Swift extension chainlayout (UI chain layout) (source code)

Coordinate transformation of graphic technology

2021-03-04 comp9021 class 6 notes
随机推荐
Simple refraction effect
The first exposure of Alibaba cloud's native security panorama behind the only highest level in the whole domain
Swift 基礎 閉包/Block的使用(源碼)
Final review and key points of software process and project management
MAYA重新拓布
Swift extension networkutil (network monitoring) (source code)
Pipeline concept of graphic technology
RCNN、Fast-RCNN、Faster-RCNN介绍
搜索与推荐那些事儿
13 -- 移除无效的括号
1279_ Vsock installation failure resolution when VMware player installs VMware Tools
到底哪一首才是唐诗第一?
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
Getting started with ffmpeg
JVM underlying principle analysis
Shader common functions
【点云数据集介绍】
MySQL source and target table row count check
根据网络上的视频的m3u8文件通过ffmpeg进行合成视频
5分钟,客服聊天处理技巧,炉火纯青