利用aspose.words帮助文档怎么设置几段文字的首字母缩进

word2013自动编号后整段文字的缩进问题_word吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:55,137贴子:
word2013自动编号后整段文字的缩进问题收藏
要将“方很多发给你”设置为对齐1.2.1那个标题,采用自动编号二级后怎么设置都不行,一级倒是可以但是(1)编号前的缩进两个字符就没有了,必须通过设置开始距离多少厘米实现,有没有其它方法?
个人简历模板word版下载上智联简历中心,热门专业简历模板,资深HR简历指导,快速制作完整简历!
回复:楼主这要通过多级列表设置对齐位置调整。
选中该段文字,打开段落右下角的箭头,选择特殊格式为首行缩进。
登录百度帐号推荐应用常用教程:
您现在的位置: > 教程 >
aspose.word设置字体字号对齐方式
17:47:25 | ReadNums | 3704 | 标签
  下面的函数功能,实现的是aspose.word设置字体字号对齐方式。  public void WriteText(string strText, double conSize, bool conBold, string conAlign) &&&&&&& { &&&&&&&&&&& oWordApplic.Bold = conB &&&&&&&&&&& oWordApplic.Font.Size = conS &&&&&&&&&&& switch (conAlign) &&&&&&&&&&& { &&&&&&&&&&&&&&& case &left&: &&&&&&&&&&&&&&&&&&& oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.L &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&& case &center&: &&&&&&&&&&&&&&&&&&& oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.C &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&& case &right&: &&&&&&&&&&&&&&&&&&& oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.R &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&& default: &&&&&&&&&&&&&&&&&&& oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.L &&&&&&&&&&&&&&&&&&& &&&&&&&&&&& } &&&&&&&&&&& oWordApplic.Write(strText); & &&&&&&&& }
问题未解决:
内容实用原创,讲得很好。
有问题请在线咨询。拒绝访问 | devask.net | 百度云加速
请打开cookies.
此网站 (devask.net) 的管理员禁止了您的访问。原因是您的访问包含了非浏览器特征(38dbfdc-ua98).
重新安装浏览器,或使用别的浏览器aspose(8)
为了帮助大家在进行word文档合并时灵活地控制列表编号,为大家提供了ImportFormatMode属性设置来进行相应的操作。在本文中,我们会给出两个合并前的文件(目标文件和源文件),每个文件都包含一个列表,每个列表都使用了名为 MyStyle的超链接样式,具体如下图:
目标文件:
在MyStyle的超链接样式下,用ImportFormatMode.KeepSourceFormatting 保留源文件格式的列表编号的代码如下:
&Document dstDoc = new Document(gDataDir + &TestFile.DestinationList.doc&);
Document srcDoc =& new Document(gDataDir + &TestFile.SourceList.doc&);
// Append the content of the document so it flows continuously.
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.C
dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
dstDoc.Save(gDataDir + &TestFile.ListKeepSourceFormatting Out.doc&);
Visual Basic
&Dim dstDoc As New Document(gDataDir & &TestFile.DestinationList.doc&)
Dim srcDoc As New Document(gDataDir & &TestFile.SourceList.doc&)
' Append the content of the document so it flows continuously.
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous
dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting)
dstDoc.Save(gDataDir & &TestFile.ListKeepSourceFormatting Out.doc&)
文件合并后效果图如下:
但是,如果我们在MyStyle的超链接样式下,使用ImportFormatMode.UseDestinationStyles 沿用目标文件格式的列表编号,会出现列表自动连续编号,如下图:
如果我们既想要沿用目标文件格式的列表编号,同时又想要防止列表的连续编号的话,我们需要运行以下代码来解决以上问题:
&Document dstDoc = new Document(gDataDir + &TestFile.DestinationList.doc&);
Document srcDoc =& new Document(gDataDir + &TestFile.SourceList.doc&);
// Set the source document to continue straight after the end of the destination document.
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.C
// Keep track of the lists that are created.
Hashtable newLists = new Hashtable();
// Iterate through all paragraphs in the document.
foreach (Paragraph para in srcDoc.GetChildNodes(NodeType.Paragraph, true))
&&& if (para.IsListItem)
&&&&&&& int listId = para.ListFormat.List.ListId;
&&&&&&& // Check if the destination document contains a list with this ID already. If it does then this may
&&&&&&& // cause the two lists to run together. Create a copy of the list in the source document instead.
&&&&&&& if (dstDoc.Lists.GetListByListId(listId) != null)
&&&&&&&&&&& List currentL
&&&&&&&&&&& // A newly copied list already exists for this ID, retrieve the stored list and use it on&
&&&&&&&&&&& // the current paragraph.
&&&&&&&&&&& if (newLists.Contains(listId))
&&&&&&&&&&& {
&&&&&&&&&&&&&&& currentList = (List)newLists[listId];
&&&&&&&&&&& }
&&&&&&&&&&& else
&&&&&&&&&&& {
&&&&&&&&&&&&&&& // Add a copy of this list to the document and store it for later reference.
&&&&&&&&&&&&&&& currentList = srcDoc.Lists.AddCopy(para.ListFormat.List);
&&&&&&&&&&&&&&& newLists.Add(listId, currentList);
&&&&&&&&&&& }
&&&&&&&&&&& // Set the list of this paragraph& to the copied list.
&&&&&&&&&&& para.ListFormat.List = currentL
// Append the source document to end of the destination document.
dstDoc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles);
// Save the combined document to disk.
dstDoc.Save(gDataDir + &TestFile.ListUseDestinationStyles Out.docx&);
Visual Basic
&Dim dstDoc As New Document(gDataDir & &TestFile.DestinationList.doc&)
Dim srcDoc As New Document(gDataDir & &TestFile.SourceList.doc&)
' Set the source document to continue straight after the end of the destination document.
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous
' Keep track of the lists that are created.
Dim newLists As New Hashtable()
' Iterate through all paragraphs in the document.
For Each para As Paragraph In srcDoc.GetChildNodes(NodeType.Paragraph, True)
&&& If para.IsListItem Then
&&&&&&& Dim listId As Integer = para.ListFormat.List.ListId
&&&&&&& ' Check if the destination document contains a list with this ID already. If it does then this may
&&&&&&& ' cause the two lists to run together. Create a copy of the list in the source document instead.
&&&&&&& If dstDoc.Lists.GetListByListId(listId) IsNot Nothing Then
&&&&&&&&&&& Dim currentList As List
&&&&&&&&&&& ' A newly copied list already exists for this ID, retrieve the stored list and use it on&
&&&&&&&&&&& ' the current paragraph.
&&&&&&&&&&& If newLists.Contains(listId) Then
&&&&&&&&&&&&&&& currentList = CType(newLists(listId), List)
&&&&&&&&&&& Else
&&&&&&&&&&&&&&& ' Add a copy of this list to the document and store it for later reference.
&&&&&&&&&&&&&&& currentList = srcDoc.Lists.AddCopy(para.ListFormat.List)
&&&&&&&&&&&&&&& newLists.Add(listId, currentList)
&&&&&&&&&&& End If
&&&&&&&&&&& ' Set the list of this paragraph& to the copied list.
&&&&&&&&&&& para.ListFormat.List = currentList
&&&&&&& End If
&&& End If
' Append the source document to end of the destination document.
dstDoc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles)
' Save the combined document to disk.
dstDoc.Save(gDataDir & &TestFile.ListUseDestinationStyles Out.docx&)
&代码运行后效果图如下:
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:206709次
积分:4218
积分:4218
排名:第7159名
原创:199篇
转载:149篇
评论:26条
阅读:1882
阅读:2814
文章:30篇
阅读:17479
文章:17篇
阅读:10647
(1)(5)(2)(8)(2)(4)(7)(2)(16)(40)(1)(8)(11)(4)(10)(4)(1)(6)(2)(4)(4)(2)(4)(6)(32)(51)(27)(13)(3)(1)(1)(3)(6)(5)(4)(9)(4)(1)(3)(7)(3)(8)(11)(1)(1)一个Aspose设置段落格式的有关问题 - ASP.NET当前位置:& &&&一个Aspose设置段落格式的有关问题一个Aspose设置段落格式的有关问题&&网友分享于:&&浏览:22次一个Aspose设置段落格式的问题利用Microsoft.Office.Interop.Word来设置段落首行缩进的方法是:WApp.Selection.ParagraphFormat.FirstLineIndent = WApp.CentimetersToPoints(float.Parse(&0&));我的问题是,我利用Aspose来设置段落首行缩进的话,怎么设置?builder.ParagraphFormat.FirstLineIndent = ??另外设置段落字体格式、段落格式,都是怎么设置的??有什么aspose的资料么。。。。------解决方案--------------------
复杂了,直接在word文档里给标签设置格式就行,不需要在程序里设计。
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有

我要回帖

更多关于 aspose.words破解版 的文章

 

随机推荐