看看这个截图:http://imagizer.imageshack.us/a/img844/4241/at9t.jpg ......这是来自Powerpoint.在那里你可以改变你的子弹.但是我创建了一个Powerpoint加载项,我需要在c#中更改项目符号.
这是如何添加第一个子弹(黑色小圆圈),但我想添加其他(白色大圆圈或其他).我怎样才能做到这一点?
char myCharacter = (char)9675; // white circle unicode
textRange.Paragraphs(i).ParagraphFormat.Bullet.Character = myCharacter;
textRange.Paragraphs(i).ParagraphFormat.Bullet.Type = PpBulletType.ppBulletUnnumbered;
Run Code Online (Sandbox Code Playgroud)
这是微软的网页,但我没有看到对我有用的东西. http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.ppbullettype(v=office.14).aspx
返回或设置用于指定文本中项目符号的Unicode字符值.读/写.
int Character { get; set; }
Run Code Online (Sandbox Code Playgroud)
如果你想白圆圈图标?的unicode是9675,你可以简单地把数为char 如下例所示或下面的概念代码.
char myCharacter= (char) 9675; // white circle unicode
textRange.Paragraphs(i).ParagraphFormat.Bullet.Character = myCharacter;
Run Code Online (Sandbox Code Playgroud)
由于它不能在你的最后工作,我已经创建了一个完成工作的例子.如果您有任何其他问题,请与我们联系.
// Create the Presentation File
Application pptApplication = new Application();
Presentation pptPresentation = pptApplication.Presentations.Add(MsoTriState.msoTrue);
CustomLayout customLayout = pptPresentation.SlideMaster.CustomLayouts[PpSlideLayout.ppLayoutText];
// Create new Slide
var slides = pptPresentation.Slides;
var slide = slides.AddSlide(1, customLayout);
// Add title
slide.Shapes[1].TextFrame.TextRange.Text = "Title of slide.com";
// Add items to list
var bulletedList = slide.Shapes[2]; // Bulleted point shape
var listTextRange = bulletedList.TextFrame.TextRange;
listTextRange.Text = "Content goes here\nYou can add text\nItem 3";
// Change the bullet character
var format = listTextRange.Paragraphs().ParagraphFormat;
format.Bullet.Character = (char)9675;
pptPresentation.SaveAs(@"c:\temp\fppt.pptx", PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoTrue);
pptPresentation.Close();
pptApplication.Quit();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1584 次 |
| 最近记录: |