int main(array<String^>^ args) { String^ documentFileName=L"Hello4.docx"; WordprocessingDocument ^myDoc = WordprocessingDocument::Create(documentFileName, WordprocessingDocumentType::Document); MainDocumentPart^ mainPart = myDoc->AddMainDocumentPart(); mainPart->Document = gcnew Document(); Body^ body = gcnew Body(); Paragraph^ paragraph = gcnew Paragraph(); Run^ run_paragraph = gcnew Run(); DocumentFormat::OpenXml::Wordprocessing::Text^ text_paragraph = gcnew DocumentFormat::OpenXml::Wordprocessing::Text(L"Hello ..asdks"); run_paragraph->Append(text_paragraph); paragraph->Append(run_paragraph); body->Append(paragraph); mainPart->Document->Append(body); mainPart->Document->Save(); return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)