The line
Code:
.Styles("Caption").ParagraphFormat.KeepWithNext = Not oCaptionsBelowImage.Value
is part of a With block:
Code:
With Application.FileDialog(msoFileDialogFilePicker)
Your code should be:
Code:
ActiveDocument.Styles(wdStyleCaption).ParagraphFormat.KeepWithNext = Not oCaptionsBelowImage.Value