It's not clear what's going on with your document, since the code on it's own provides no context. That said, it seems to me that having:
Dim i As Long
is not consistent with:
i = Replace(Selection.FormFields(1).Range.Bookmarks(1) .Name, "DropDown", "")
since the latter returns a string, not a number.
Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
PS: When posting code, please use the code tags, indicated by the # button on the posting menu.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|