注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Mr.Right

不顾一切的去想,于是我们有了梦想。脚踏实地的去做,于是梦想成了现实。

 
 
 

日志

 
 
关于我

人生一年又一年,只要每年都有所积累,有所成长,都有那么一次自己认为满意的花开时刻就好。即使一时不顺,也要敞开胸怀。生命的荣枯并不是简单的重复,一时的得失不是成败的尺度。花开不是荣耀,而是一个美丽的结束,花谢也不是耻辱,而是一个低调的开始。

网易考拉推荐

阿英讲Word图片VBA批量增加"自定义的"题注  

2015-10-12 23:57:40|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
即以此功德,庄严佛净土。上报四重恩,下济三途苦。惟愿见闻者,悉发菩提心。在世富贵全,往生极乐国。

Sub SetFigCaptionNumber()
Dim n As Integer '图片个数
On Error Resume Next '忽略错误

CaptionLabels.Add Name:="图"
'MsgBox CaptionLabels(5).Name

CaptionLabels("图").NumberStyle = wdCaptionNumberStyleArabic
    
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes类型图片
    ActiveDocument.InlineShapes(n).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter ' 使得题注居中
    ActiveDocument.InlineShapes(n).Range.InsertCaption _
    Label:="图", _
    Position:=wdCaptionPositionBelow ' 增加题注
Next n

End Sub



---------------------------------------------------------------------------------------

InsertCaption Method

Office 2003

Inserts a caption immediately preceding or following the specified range or selection.

expression.InsertCaption(LabelTitleTitleAutoTextPositionExcludeLabel)

expression Required. An expression that returns a Range or Selection object.

WdCaptionLabelID

Can be a string or one of the following WdCaptionLabelID constants.

wdCaptionEquation

wdCaptionFigure

wdCaptionTable

If the label hasn't yet been defined, an error occurs. Use the Add method with the CaptionLabels object to define new caption labels.

Title    Optional Variant. The string to be inserted immediately following the label in the caption (ignored ifTitleAutoText is specified).

TitleAutoText    Optional Variant. The AutoText entry whose contents you want to insert immediately following the label in the caption (overrides any text specified by Title).

WdCaptionPosition

Can be either of the following WdCaptionPosition constants.

wdCaptionPositionAbove

wdCaptionPositionBelow.

ExcludeLabel    Optional VariantTrue does not include the text label, as defined in the Label parameter. Falseincludes the specified label.

Example

This example inserts a caption below the first table in the active document.

ActiveDocument.Tables(1).Range.InsertCaption _
    Label:=wdCaptionTable, _
    Position:=wdCaptionPositionBelow

This example inserts a Figure caption at the insertion point.

Selection.Collapse Direction:=wdCollapseStart
Selection.InsertCaption Label:="Figure", _
    Title:=": Sales Results", Position:=wdCaptionPositionBelow
---------------------------------------------------------------------------------------

CaptionLabels Property

Office 2003

Returns a CaptionLabels collection that represents all the available caption labels. Read-only.

For information about returning a single member of a collection, see Returning an Object from a Collection .

Example

This example sets the numbering style for table captions.

CaptionLabels(wdCaptionTable).NumberStyle = _
    wdCaptionNumberStyleLowercaseRoman
		

This example adds a new caption label named "Photo" and then inserts a photo caption.

CaptionLabels.Add Name:="Photo"
With Selection
    .InsertParagraphAfter
    .InsertCaption Label:="Photo"
End With

Use CaptionLabels(index), where index is the caption label name or index number, to return a single CaptionLabel object. The following example sets the numbering style for the Figure caption label.

CaptionLabels("Figure").NumberStyle = _ 
 wdCaptionNumberStyleLowercaseLetter

The index number represents the position of the caption label in the CaptionLabels collection. The following example displays the first caption label.

MsgBox CaptionLabels(1).Name

Use the Add method to add a custom caption label. The following example adds a caption label named "Photo."

CaptionLabels.Add Name:="Photo"
---------------------------------------------------------------------------------------

WdCaptionNumberStyle Enumeration

Specifies the number style to be used with the CaptionLabel object.
NameValueDescription
wdCaptionNumberStyleArabic0Arabic style.
wdCaptionNumberStyleArabicFullWidth14Full-width Arabic style.
wdCaptionNumberStyleArabicLetter146Arabic letter style 1.
wdCaptionNumberStyleArabicLetter248Arabic letter style 2.
wdCaptionNumberStyleChosung25Chosung style.
wdCaptionNumberStyleGanada24Ganada style.
wdCaptionNumberStyleHanjaRead41Hanja read style.
wdCaptionNumberStyleHanjaReadDigit42Hanja read digit style.
wdCaptionNumberStyleHebrewLetter145Hebrew letter style 1.
wdCaptionNumberStyleHebrewLetter247Hebrew letter style 2.
wdCaptionNumberStyleHindiArabic51Hindi Arabic style.
wdCaptionNumberStyleHindiCardinalText52Hindi cardinal style.
wdCaptionNumberStyleHindiLetter149Hindi letter style 1.
wdCaptionNumberStyleHindiLetter250Hindi letter style 2.
wdCaptionNumberStyleKanji10Kanji style.
wdCaptionNumberStyleKanjiDigit11Kanji digit style.
wdCaptionNumberStyleKanjiTraditional16Kanji traditional style.
wdCaptionNumberStyleLowercaseLetter4Lowercase letter style.
wdCaptionNumberStyleLowercaseRoman2Lowercase roman style.
wdCaptionNumberStyleNumberInCircle18Number in circle style.
wdCaptionNumberStyleSimpChinNum238Simplified Chinese number style 2.
wdCaptionNumberStyleSimpChinNum339Simplified Chinese number style 3.
wdCaptionNumberStyleThaiArabic54Thai Arabic style.
wdCaptionNumberStyleThaiCardinalText55Thai cardinal text style.
wdCaptionNumberStyleThaiLetter53Thai letter style.
wdCaptionNumberStyleTradChinNum234Traditional Chinese number style 2.
wdCaptionNumberStyleTradChinNum335Traditional Chinese number style 3.
wdCaptionNumberStyleUppercaseLetter3Uppercase letter style.
wdCaptionNumberStyleUppercaseRoman1Uppercase roman style.
wdCaptionNumberStyleVietCardinalText56Vietnamese cardinal text style.
wdCaptionNumberStyleZodiac130Zodiac style 1.
wdCaptionNumberStyleZodiac231Zodiac style 2.


  评论这张
 
阅读(252)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016