Hello again,

It looks like I got ahead of myself in my last post.

Perhaps someone here can help me modify a line of code to help me transfer Word Bookmark values to Excel.

The code that I have works partially. I would imagine that to get it to work fully is a relatively simple thing.

I hope you can help.

The Excel macro in question asks for a starting row number, a starting column number, the Word file(s) to use, and whether or not it should print the bookmark names (as opposed to the values) on the first row.

That part works excellent. Every single Bookmark name, in alphabetical order, gets listed across the first row.

The macro designer cycles through variable x, which is 1 to WordDoc.Bookmarks.Count.

They are spit out like this:

[vba]ActiveSheet.Cells(intRow, x + intCol - 1) = WordDoc.Bookmarks(x).Name[/vba]

And it's fine. 50 Bookmark names get printed across the row.

Now, here is the difficulty I am having....

I noticed that in the subsequent rows, where I want the bookmark values, some cells are blank!!

(I hope I am making sense here...)

I noticed that any time I have named (bookmarked) a formfield, such as a Drop Down or text box, the value indeed gets pasted.

However, if it is a "regular" bookmark (for example, if I select a phrase in the protected part of the form.... or if I select a calculated field).. then it leaves it blank.

Looking at the code that I have, the guy wrote this:

[vba]
ActiveSheet.Cells(intRow + intFileNum, x + intCol - 1) = WordDoc.FormFields(WordDoc.Bookmarks(x).Name).Result
[/vba]

(It cycles through X to number of bookmarks again..)

...so from what I gather... he is pasting the Formfields that have Bookmark names attached to them.

..and that is what it is doing. But that is not what I want it to do!

I then have blank cells where all my calculated fields should be, as well as my values that are hardcoded into the form in protected areas that have bookmarks attached.

Can someone please tell me what I would need instead of:

[vba]
WordDoc.FormFields(WordDoc.Bookmarks(x).Name).Result
[/vba]


If anyone can help, I would reallly appreciate it!