locked
im gettinfg this error "The name 'DocX' does not exist in the current context" RRS feed

  • Question

  • usingSystem.Diagnostics;

    namespaceBlogSandbox

    {

    publicclassDocX_Examples

    {

    publicvoidCreateSampleDocument()

    {

    // Modify to suit your machine:

    stringfileName = @"D:\Users\John\Documents\DocXExample.docx";

    // Create a document in memory:

    vardoc = DocX.Create(fileName);

    // Insert a paragrpah:

    doc.InsertParagraph("This is my first paragraph");

    // Save to the output directory:

    doc.Save();

    // Open in Word:

    Process.Start("WINWORD.EXE", fileName);

    }

    }

    }

    • Moved by litdev Friday, August 11, 2017 5:44 PM
    Friday, August 11, 2017 9:58 AM

Answers

All replies