EvotecIT / OfficeIMO

Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
280 stars 50 forks source link

Object reference not set to an instance of an object when adding bookmark #66

Closed PrzemyslawKlys closed 1 year ago

PrzemyslawKlys commented 1 year ago

Example showing issue: HeadersAndFooters.Sections1(folderPath, false);

image

System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=OfficeIMO.Word StackTrace: at OfficeIMO.Word.WordBookmark.AddBookmark(WordParagraph paragraph, String bookmarkName) in C:\Support\GitHub\OfficeIMO\OfficeIMO.Word\WordBookmark.cs:line 54

https://github.com/EvotecIT/OfficeIMO/blob/e4cc3542a9d629ee3014a1c818441fa1636510e9/OfficeIMO.Examples/Word/HeadersAndFooters/HeadersAndFooters.Sections1.cs#L14-L25