1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
String path;
TSaveDialog* TSD_Save = new TSaveDialog(this);
TSD_Save->InitialDir = "C:\\";
TSD_Save->Title = "Enregistrer sous...";
TSD_Save->Filter = "Fichiers Ods (*.ods)|*.ODS";
TSD_Save->FileName = "Fichier_xls.xls";
if (TSD_Save->Execute())
{
path = TSD_Save->FileName;
path = StringReplace(path,"<a href="file://\\","/",TReplaceFlags" target="_blank">\\","/",TReplaceFlags</a>()<< rfReplaceAll << rfIgnoreCase);
path = "<a href="file:///" target="_blank">file:///</a>" + path;
}
// fonction enregistrer sous
Variant vOOoPrSousxls = vOOoOpenOffice.OleFunction("Bridge_GetStruct","com.sun.star.beans.PropertyValue");
vOOoPrSousxls.OlePropertySet("Name","FilterName");
vOOoPrSousxls.OlePropertySet("Value","MS Excel 97"); // pour le format PDF "Value" = "writer_pdf_Export"
int Bounds[2] = {0, 0};
Variant fichsave = VarArrayCreate(Bounds, 1, varVariant);
fichsave.PutElement(vOOoPrSousxls,0);
// vOOoDocument.OleFunction("storeAsUrl", WideString(path), fichsave); // pour path declare en variant
vOOoDocument.OleFunction("storeAsUrl", path.c_str(), fichsave); // pour path declare en string |
Partager