I have a dialog that contains three spreadsheets of the class CSpreadSheet. I was trying to use the following export function to export the data to a text file:

BOOL CSpreadSheet::ExportToTextFile(LPCTSTR FileName, LPCTSTR CellDelim, LPCTSTR ColDelim, LPCTSTR RowDelim, long Flags, LPCTSTR LogFile);

My code currently looks something like this:

m_Page1.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");
m_Page2.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");
m_Page3.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");

The problem is that each export overwrites the file. Is there a flag or other parameter I can use so that the data is appended to the text file, rather than overwriting it?


I found a flag (OF_READWRITE) which did the trick. Thanks for your help.

Incidentally, I am using Farpoint Spread 6.

This question has already been answered. Start a new discussion instead.