Return figure caption # to program

A

agreenfield1

I am using the command

Selection.InsertCaption Label:="Figure",
TitleAutoText:="InsertCaption1", _
Title:="", Position:=wdCaptionPositionBelow

to place a caption. How can I return the figure caption number just
inserted to my VBA program?

Thanks,
Andrew
 
D

Doug Robbins - Word MVP

Hi Andrew,

Use:

Selection.InsertCaption Label:="Figure", TitleAutoText:="InsertCaption1", _
Title:="", Position:=wdCaptionPositionBelow
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
MsgBox Selection.Fields(1).Result
Selection.Collapse wdCollapseEnd


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top