Copy Table into document with vbs

Hi,

I would like to create a tool to copy specifed tables (RTELEM_TYPE_TABLE) from a base document into new documents. For examle the base document contains 4 tables, and I would like to create 4 document, and copy 1-1 table into each document.

Is this possible? (I hope yes :slight_smile: )

I can find the tables with the navigator which I would like to copy, but I can’t insert it into the new document. Always shows “Type mismatch” error.

Could someone please help me, how to copy a specifed table into a document?

Thanks in advance

David Keszte

Subject: Copy Table into document with vbs

Hi,

Try to find line of code in which that error occures.

Put here some your code.

From help:

One of the following conditions could have caused this error (type mismatch):

  • You attempted an operation on operands with conflicting data types.

  • You assigned a value to a variable that has a different data type, and LotusScript cannot convert it automatically.

  • You are passing a value as an argument that has a different declared data type, and LotusScript cannot convert it automatically.

  • You used a string as the initial value, or as the To or Step value, in a For statement.

Konrad

Subject: RE: Copy Table into document with vbs

Hi,

I know (or i think i know) why the Type Mismatch error occures. When I position the Navigator (nav) to the specified RTELEM_TYPE_TABLE and then rtt = nav.GetElement, the rtt variable contains a RichTextTable object (the table i would like to copy into a new document). I can’t insert it into a new doc because the CopyItem and CopyItemToDocument methods are for NotesItems and not for RichTextTables.

This is my main problem, and I could not found anything to solve this problem.

Is there any way to convert the object, or to insert the “rtt” (RichTextTable) variable into a document? ( RichTextItem )

Thanks

David Keszte

Subject: RE: Copy Table into document with vbs

Can you split that 4 tables in base document into 4 rich text fields?Then copying will be easy (AppendRTItem, CopyItem etc.).

Konrad

Subject: RE: Copy Table into document with vbs

Is it possible? I don’t know how to split the 4 tables into 4 individual RTItems.Sry, I’m quite new to handling notes using vbs :frowning:

Thanks

David

Subject: RE: Copy Table into document with vbs

Manually - yes. Depends on situation which you have.

Or programically - by creating 4 copies of base RT item, then removing in each RT item 3 (“don’t needed”) tables by: Call notesRichTextTable.Remove.

Konrad

Subject: RE: Copy Table into document with vbs

Hi,

I have to do this programically.

So I must create 4 copies from the base document, then remove the tables which are not needed and leave the 1 table in each document.

I’ll try this, thx.

My only concern is, what if the size of the tables are big (20-50-100MB). Won’t this slow down things? (if I don’t have other choises, then this will be done)

Thank you for the help

David

Subject: RE: Copy Table into document with vbs

Yes, that operation may be slow.

I don’t know what is your bussiness situation in that case.

What is base document? Is it something like configuration document?

Why do you have in base document 4 tables in one RT and you need to copy one table to one RT?

Question form my first post is if it is possible to split tables to 4 RT items in base document - so I mean to process that operation only one time (yes, it may be slow) not every time you will create new document from base document.

Konrad

Subject: RE: Copy Table into document with vbs

Hi,

The situation is a bit complicated, but I’ll try to explain it.

My collegaues are updating many many tables (more than 4) in a document, inserting files, sections, pictures, etc. into it manually. When one of the tables is ready, I have to copy the completed table into a new document, and save it in the TR, so the new document contains only the completed table.

To make things worse, in the base document, the tables are in sections (when the table is ready, the title of the section is changed so the tool can find the completed tables) and then I have to copy the table in the section into a new document.

At the moment, I can locate the table which must be copied, so the only problem is how to copy the selected table into the new doc automatically.

I’ve found DXLExporter, but don’t know what is it exactly. Can it be used for this?

Thanks

David

Subject: Copy Table into document with vbs

Is there any other way to copy an individual RTELEM_TYPE_TABLE object from a document into another document?

Thx in advance!

David Keszte