CopyAllItems copies text but not table format

I have a document that contains a tabbed table. To format it for printing, I am creating another document (a print version of the same form) and using copyallitems to move the data to the new form. One of the fields on the form contains a table. If I run the code from the view, everything works fine. However, if I run the code from the open document, the text from the table is saved, but not the table itself. This is not a new document so this is not an issue of saving the rich text field. The code is below:

'Everything is declared prior to this.

'docCurrent is the document that I want to

'print and it is passed in.

'Create the temporary Summary print form

Set printdoc = dbCurrent.CreateDocument

Call docCurrent.CopyAllItems (printdoc, False)

printdoc.form = “Print Summary”

Call printdoc.Save (True, False)

Run from the view, the table is perfect. Run from the open document, the table no longer exists. The text is separated by carriage returns. I am at a loss as to what could be causing this - any help or ideas would be greatly appreciated.

Subject: CopyAllItems copies text but not table format

I usually use simply the @ command:

@Command( [SwitchForm] ; formName )

This displays the same document, but uses a different form. No LS, no copying fields…

Just make sure that the new form contains either a form field that’s set to the old form name, or use the field SaveOptions set to “0” so that the user does not save the document with the other form name.

Subject: RE: CopyAllItems copies text but not table format

Thanks for the suggestion, but unfortunately in this case it isn’t as simple as switching the form. The code I am having problems with is embedded in a bunch of other code that is processing the documents in other ways. I need to be able to use script to create the print document.

Subject: RE: CopyAllItems copies text but not table format

Make sure the field on the print form is still a rich text field.

Subject: RE: CopyAllItems copies text but not table format

It is definately still rich text on the print form. Believe me I have checked and rechecked and then checked again. This is just so weird - I can find no explanation for this behavior!

Subject: RE: CopyAllItems copies text but not table format

Is the rich text field computed or editable? If computed, it can do odd things. Also, is it on a subform or on the main form?

Subject: RE: CopyAllItems copies text but not table format

That is what is was. The field on the source document needed to be set to editable instead of computed.

Thanks for the help!