Referencing a newly created caption

P

peacelittleone

I am able to convert a text string in my word document to a caption by using
the Selection.InsertCaption method.

How do I then, say, center align the caption? Or do something else with it?
 
J

Jean-Guy Marcil

peacelittleone was telling us:
peacelittleone nous racontait que :
I am able to convert a text string in my word document to a caption
by using the Selection.InsertCaption method.

How do I then, say, center align the caption? Or do something else
with it?

Show us your code.
 
P

peacelittleone

peacelittleone was telling us:
peacelittleone nous racontait que :



Show us your code.


Here is my code:

currCaption = CaptionTitle(currParagraph)
ActiveDocument.Paragraphs(index).Range.Text = "" & Chr
(10)
Selection.InsertCaption Label:="Figure",
TitleAutoText:="", _
Title:=currCaption,
Position:=wdCaptionPositionBelow, ExcludeLabel:=0

What I'd like to be able to do is format the newly created caption -
like center it. How do I get a reference or a handle to it?
 
F

fumei via OfficeKB.com

Do not do this. While not indicated in Help (InsertCaption) using
InsertCaption automatically (and behind the scene) uses the Caption style.
This is the whole point.

It is never a good idea to manually (or even by code) change the attributes a
style.

If you must change the format attributes, then change the Style itself.
peacelittleone said:
peacelittleone was telling us:
peacelittleone nous racontait que :
[quoted text clipped - 11 lines]
Jean-Guy Marcil
Montreal, Canada

Here is my code:

currCaption = CaptionTitle(currParagraph)
ActiveDocument.Paragraphs(index).Range.Text = "" & Chr
(10)
Selection.InsertCaption Label:="Figure",
TitleAutoText:="", _
Title:=currCaption,
Position:=wdCaptionPositionBelow, ExcludeLabel:=0

What I'd like to be able to do is format the newly created caption -
like center it. How do I get a reference or a handle to it?
 
P

peacelittleone

Do not do this.  While not indicated in Help (InsertCaption) using
InsertCaption automatically (and behind the scene) uses the Caption style..
This is the whole point.  

It is never a good idea to manually (or even by code) change the attributes a
style.

If you must change the format attributes, then change the Style itself.


peacelittleone was telling us:
peacelittleone nous racontait que :
[quoted text clipped - 11 lines]
Jean-Guy Marcil
Montreal, Canada
Here is my code:
               currCaption = CaptionTitle(currParagraph)
               ActiveDocument.Paragraphs(index).Range.Text = "" & Chr
(10)
               Selection.InsertCaption Label:="Figure",
TitleAutoText:="", _
                   Title:=currCaption,
Position:=wdCaptionPositionBelow, ExcludeLabel:=0
What I'd like to be able to do is format the newly created caption -
like center it.  How do I get a reference or a handle to it?

ok. Thanks.
 
Top