Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2545|回复: 1

[已解决]设置word中倒数第二行文字格式的vba代码

[复制链接]
发表于 2014-1-13 09:43 | 显示全部楼层 |阅读模式
设置word中倒数第二行文字格式的vba代码

将倒数第二行的文字的格式设置为:

字体为25号,黑体
右对齐方式


请老师是们帮帮忙,谢谢大家了!
最佳答案
2014-1-13 21:34
  1.     With Selection

  2.         .EndKey Unit:=wdStory
  3.         .MoveUp Unit:=wdLine, Count:=1
  4.         .EndKey Unit:=wdLine, Extend:=wdExtend
  5.         Debug.Print .Range.Text

  6.         With .Font
  7.             .Size = 25
  8.             .Name = "黑体"
  9.         End With
  10.         With .ParagraphFormat
  11.             .Alignment = wdAlignParagraphRight
  12.         End With
  13.         .HomeKey Unit:=wdStory
  14.     End With
复制代码
录的。
发表于 2014-1-13 21:34 | 显示全部楼层    本楼为最佳答案   
  1.     With Selection

  2.         .EndKey Unit:=wdStory
  3.         .MoveUp Unit:=wdLine, Count:=1
  4.         .EndKey Unit:=wdLine, Extend:=wdExtend
  5.         Debug.Print .Range.Text

  6.         With .Font
  7.             .Size = 25
  8.             .Name = "黑体"
  9.         End With
  10.         With .ParagraphFormat
  11.             .Alignment = wdAlignParagraphRight
  12.         End With
  13.         .HomeKey Unit:=wdStory
  14.     End With
复制代码
录的。

评分

参与人数 1 +9 收起 理由
yjwdjfqb + 9 很给力!

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-25 14:26 , Processed in 0.565926 second(s), 15 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表