摘要:
word中导出目录是一个常见的问题。详细代码如下:public static void ExportMenu(int maxLevel, Document word) //利用标题样式生成目录 { //GoToTheBeginning(word); ... 阅读全文
摘要:
生成word时,有时用户要求要生成所有级别的目录。这个时候就需要计算目录树的深度。关于求树的深度,已有很多现成的算法。本文主要介绍一种linq的写法。代码看起来挺简洁的。public static int MenuDepth(List menuList, int parentId) {... 阅读全文