View Single Post
 
Old 12-26-2020, 04:52 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I don't see where you're centring the caption, which in any event should be accomplished by modifying the Caption Style, not by overriding the paragraph format in code. Indeed, your line:
Code:
oTbl.Cell(r + 1, c).Range.Text = StrTxt
eliminates all of Word's implementation of normal captioning conventions.

To fit the text to the cell, you could use the .FitText method. See the relevant code in the link.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote