Firstly, your code has an objShape which looks like it should be an iShape
The code is looking at the first field in the paragraph below the inline shape. Can you confirm that the first field is a sequence field because it could also be a styleref field (if your captions include the chapter number). This might need adjustment to dig further to decide whether a 'caption' already exists there. You could test for a style or look through all fields in that paragraph for instance
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|