Skip to content

Cells Pictures "NULL REFERENCE EXCEPTION" #17

@gerh87

Description

@gerh87

Hello every one! I am making a replace text into .docx file, but I need to access the shapes like "checkboxs", these are into a table. When I read the template.Tables[1].Rows[0].Cells[0].Pictures, the last object give me the next exception: System.NullReferenceException
I can not undertund why, I need change this shapes/pictures on my replace process:
This is my code:

   private static DocX CreateInvoiceFromTemplate(DocX template)
    {
        var tables = template.Tables;
        var dataRepository = DataDocumentRepository.Instance;
        template.ReplaceText("{EmployerName}", "PABLO H");
        var pics = template.Tables[1].Rows[0].Cells[0].Pictures;
        template.ReplaceText("{DateImplemented}", DateTime.Now.ToString("yyyy/MM/dd"));
        return template;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions