I am entirely new to VBA. I use Windows 10 and Microsoft Word 2016. I created a macro through the Record Macro which is intended to format a text box caption for a picture. I wish I could upload the macro but it won't let me copy and paste. The problem is that the macro only works for the text box you have just created. When you try to reuse it, it is still looking for that text box. The runtime error is 2147024809(80070057) "the item with the specific name wasn't found". The line of code which the debugger points to is

ActiveDocument.Shapes.Range(Array("Text Box 2")).Select

I think it is looking for Text Box 2 but the new text box isn't named that. Is there code that can get it to accept any new text box caption you insert instead of specifically looking for the last text box you inserted? I don't know programming language but just wanted to make formatting the captions more easy with a macro.

Thank you for your reply.

Tindomerel