PDA

View Full Version : Vertically merged cells error



Teacha
11-13-2007, 10:23 AM
Hello experts,
I am trying to determine a work around for a vertically merged cells error I get when I run a macro in a Word.

I have a template used to create a file of multiple templates that was created entirely with a table. (merged and shaded and all to help with data entry) Once this file of data has been compiled the macros splits the files up by tables. I have code that works for that, I am having touble naming the newly split files because I want them to be named by a certain alphanumeric code that is in a specific location in each table of the original file. I cannot access the contents (i dont think so anyway) by using
strCellText = ActiveDocument.Tables(1).Rows(1).Cells(1).Range.Text
because it gives a Runtime error 5991 Cannot access individual rows in this collection because the table has vertically merged cells.

Is there a work around, can i access this table entry another way so I can use it in the file name?:doh:

Some info that might be helpful is that the code I am looking to use is always preceeded by the word "code" in the cell immediately to the left.

fumei
11-13-2007, 01:34 PM
Yes.

Bookmark the entry, and use that.

This job could be made even easier by bookmarking the tables themselves as well.

Teacha
11-13-2007, 02:40 PM
I agree. I did think bookmarks would work, but when the user copies the template into the document that requries the split, it does not copy the bookmark. You see, the template will be cut and pasted in to a compiled document with several of the tables populated with a variety of data.:dunno
So i didnt think you could have multiple bookmarks with the same name in one document. If you can, how can I ensure its captured with a cut and paste by the user?

fumei
11-14-2007, 01:06 PM
1. Correct, you can not have multiple bookmarks with the same name in a document.

2. I am not following the process, but as it seems to be doing strange stuff with "templates", I don't think I can help. I do not understand what the cut and paste is about. I do not follow the idea of a template being cut and paste. I do not even follow why you think there would even BE multiple bookmarks with the same name. Users should not be copying anything from a template. Templates make new documents.

So the template HAS the bookmarks, a different one in each table. The template is cloned into a new document. That new document will have the bookmarks.

"that is in a specific location in each table of the original file"

My emphasis. So why would there be bookmarks of the same name???????

TonyJollans
11-16-2007, 02:00 PM
I'm with Gerry. Can you describe in more detail what exactly you are doing?