Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I take it you have tried something? I don't have access to a compiler</p> <p><a href="http://en.wikipedia.org/wiki/C%2B%2B/CLI" rel="nofollow">http://en.wikipedia.org/wiki/C%2B%2B/CLI</a> should get you started.</p> <p>If you wonder about translating the <code>using</code> construct (good question, had you asked it!), I suggest something along the following lines (note the <code>try {} finally { delete ... }</code> idom)</p> <pre><code>private: void HelloWorld(String^ documentFileName) { // Create a Wordprocessing document. WordprocessingDocument ^myDoc = WordprocessingDocument::Create(documentFileName, WordprocessingDocumentType::Document); try { // Add a new main document part. MainDocumentPart mainPart = myDoc::AddMainDocumentPart(); //Create Document tree for simple document. mainPart-&gt;Document = gcnew Document(); //Create Body (this element contains //other elements that we want to include Body body = gcnew Body(); //Create paragraph Paragraph paragraph = gcnew Paragraph(); Run run_paragraph = gcnew Run(); // we want to put that text into the output document Text text_paragraph = gcnew Text("Hello World!"); //Append elements appropriately. run_paragraph-&gt;Append(text_paragraph); paragraph-&gt;Append(run_paragraph); body-&gt;Append(paragraph); mainPart-&gt;Document-&gt;Append(body); // Save changes to the main document part. mainPart-&gt;Document-&gt;Save(); } finally { delete myDoc; } } </code></pre> <p>I want to repeat I have no compiler available at the moment, so it may be rough around the edges, but should provide some information nonetheless</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload