|
楼主 |
发表于 2024-4-11 13:24
|
显示全部楼层
非常感谢!可以实现,只是每次都需AddTextEffect。因为要循环利用shape,原想利用已有的shape(excel可以)。
【原代码功能:利用Excel实现单位会场快速排座位并打印座位牌。因需转到wps中,故作代码移植。】
- function test() {
- let n=0;//增加艺术字垂直方向上的距离
- ArtWord("shapeName1", "hello",n);
- n++;
- ArtWord("shapeName2", "World",n);
- }
- function ArtWord(shapeName, txt, n) {
- var newArtWord;
- var sht1 = Worksheets("Sheet1");
- newArtWord = sht1.Shapes.AddTextEffect(msoTextEffect1, txt, "黑体", 24, msoFalse, msoFalse, 40, 50*(n+1));
- newArtWord.Name = shapeName;
- MsgBox("pause...");
- if(n>0){
- sht1.Shapes("shapeName1").Delete();
- sht1.Shapes("shapeName2").Delete();
- }
- }
复制代码
|
|