{
Com document;
str pdfPath;
str finalPath;
int length;
int minus;
str filePath;
container confilter = ["DOC","*.doc"];
filePath = Winapi::getSaveFileName(0,conFilter,"","Save As",".doc","contracts");
document.saveas(filePath);
document.activate();
document.save();
length = strlen(filePath);
minus = length - 3;
pdfPath = strdel(filePath,minus,4);
finalPath = pdfPath + ".pdf";
document.ExportAsFixedFormat(finalPath,17);
document.close();
word.quit();
WinAPI::deleteFile(filePath);
}