I am looping through all of the bookmarks in a document. There is a Excel name which is the same as the bookmark. I would like to retain the Excel format.
Code
numBookmarks = ActiveDocument.Bookmarks.Count
For counter = 1 To numBookmarks
bmk = ActiveDocument.Bookmarks(counter).Name
Selection.GoTo What:=wdGoToBookmark, Name:=bmk
Selection.TypeText Format(myWB.Sheets("Job Sheet").Range(bmk), "00000")
Next counter
In the example, I have hardcoded the "00000" format for a U.S. Zipcode. Other defined names could be for dates, dollar amounts, etc.
Is there a way to use the format found in Excel for that defined name.