void MsWordDocument::saveAsDoc(const QString& filename){ if (filename.isEmpty() || QFile::exists(filename)) return; QList<QVariant> params; QVariant newFileName(filename); QVariant fileFormat(0); //doc QVariant LockComments(false); QVariant Password(""); QVariant recent(true); QVariant writePassword(""); QVariant ReadOnlyRecommended(false); QVariant EmbedTrueTypeFonts(true); QVariant SaveNativePictureFormat(true); QVariant SaveFormsData(false); QVariant SaveAsAOCELetter(false); QVariant Encoding(20127); QVariant InsertLineBreaks(false); QVariant AllowSubstitutions(false); QVariant LineEnding(0); QVariant AddBiDiMarks(false); params << newFileName << fileFormat << LockComments << Password << recent << writePassword << ReadOnlyRecommended << EmbedTrueTypeFonts << SaveNativePictureFormat << SaveFormsData << SaveAsAOCELetter << Encoding << InsertLineBreaks << AllowSubstitutions << LineEnding << AddBiDiMarks; WordApplication->querySubObject("ActiveDocument()")->querySubObject("SaveAs(const QVariant&, const QVariant&," "const QVariant&, const QVariant&, const QVariant&, const QVariant&,const QVariant&, const QVariant&, const QVariant&," "const QVariant&, const QVariant&, const QVariant&, const QVariant&, const QVariant&, const QVariant&, const QVariant&)", params);}
QVariant Encoding(20127);
QVariant fileName("C:\\path\\somewhere\\file.ext"); QVariant confirmConversions(false); QVariant readOnly(true); QVariant passWordDocument; QVariant passwordTemplate(""); QVariant revent(false); QVariant writePasswordDocument(""); QVariant writePassWordTemplate(""); QVariant format(0); QVariant encoding(1251); QList<QVariant> list; list<<fileName<<confirmConversions<<readOnly<<NULL<<passwordTemplate<<revent<<writePasswordDocument; list<<writePassWordTemplate<<format<<encoding; WordDocuments->querySubObject("Open(const QString&,const QString&,const QString&,const QString&,const QString&,const QString&,const QString&,const QString&,const QString&)",list);