Hi,
With the code your provided, I add WKS_EXPORT_HEADING and WKS_EXPORT_LABELS to the ExportASCII method, and it works fine, both long names and labels are exported to the file.
foreach( PageBase pgbs in Project.Pages )
{
if( EXIST_WKS == pgbs.GetType() )
{
WorksheetPage wks(pgbs);
Worksheet works = wks.Layers(0);
string fldr = "c:\\SpecifiedPlaceHere\\" ;
bool bRet1 = CreateDirectory(fldr, NULL);
if(!bRet1)
return;
string fldr2 = "c:\\SpecifiedPlaceHere\\" + Project.GetName() + "\\";
bool bRet2 = CreateDirectory(fldr2, NULL);
if(!bRet2)
return;
string strWKSPath = fldr2 + Project.GetName() + '-' + wks.GetName() + ".txt";
printf("File: %s\n", strWKSPath);
// Call function to export page with desired settings
int iRet = works.ExportASCII(strWKSPath, WKS_EXPORT_ALL|WKS_EXPORT_HEADING|WKS_EXPORT_LABELS);
if(iRet == -1)
out_str("Failed to export!");
}
}
Please note one thing, CreateDirectory function can only create one subdirectory in the existing directory. Take a look the code above.
Penn