Hi we have been trying to nest bookmarks in aspose.word using the methods you have shown in this page http://www.aspose.com/docs/display/wordsnet/Bookmarks+in+Aspose.Words
Hi Graeme,
Thanks for your inquiry. Please use the following code snippet to create nested bookmark. Hope this helps you.
Document doc = new Document(MyDir + “in.docx”);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.StartBookmark("MyBookmark");
builder.Writeln("Text inside a bookmark.");
builder.StartBookmark("NestedBookmark");
builder.Writeln("Text inside a NestedBookmark.");
builder.EndBookmark("NestedBookmark");
builder.Writeln("Text after Nested Bookmark.");
builder.EndBookmark("MyBookmark");
doc.Save(MyDir + "Out.docx");
PdfSaveOptions options = new PdfSaveOptions();
options.OutlineOptions.BookmarksOutlineLevels.Add("MyBookmark", 1);
options.OutlineOptions.BookmarksOutlineLevels.Add("NestedBookmark", 2);
options.OutlineOptions.ExpandedOutlineLevels = 9;
doc.Save(MyDir + "Out.pdf", options);
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>
<![endif]–>If you still face problem, please share your expected output Word and Pdf documents here for our reference. We will investigate how you want your final output be generated like. We will then provide you more information on this along with code.