C# OpenXML:在c中创建power point时#
我使用下面的代码,在这段代码中PowerPointTemplate()给出了错误,即 PowerPointTemplate()未在intellisense中显示,因为它应在openXML中显示C# OpenXML:在c中创建power point时#,c#,asp.net-mvc-4,C#,Asp.net Mvc 4,我使用下面的代码,在这段代码中PowerPointTemplate()给出了错误,即 PowerPointTemplate()未在intellisense中显示,因为它应在openXML中显示 public class PowerPointParameter { public string Name { get; set; } public string Text { get; set; } public FileInfo Image { get; set; } }
public class PowerPointParameter
{
public string Name { get; set; }
public string Text { get; set; }
public FileInfo Image { get; set; }
}
var templ = new PowerPointTemplate();
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "[#Paragraph1#]", Text = "Slide 1" });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "[#Paragraph2#]", Text = "Slide 2" });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "[#List1(string[])#]", Text = "test1 \n test 2 \n test3 \n test 2" });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "[#List2(string[])#]", Text = "test1 \n test 2 \n test3 \n test 2" });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "1", Image = new FileInfo(GetRootPath() + @"\Images\1.jpg") });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "2", Image = new FileInfo(GetRootPath() + @"\Images\2.jpg") });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "3", Image = new FileInfo(GetRootPath() + @"\Images\3.jpg") });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "4", Image = new FileInfo(GetRootPath() + @"\Images\4.jpg") });
templ.PowerPointParameters.Add(new PowerPointParameter() { Name = "5", Image = new FileInfo(GetRootPath() + @"\Images\5.jpg") });
var templatePath = GetRootPath() + @"\Templates\Template.pptx";
var outputPath = GetRootPath() + @"\Output\Document.pptx";
另外,我还添加了OpenXML和WindowsBase
http://www.dotnet-geek.co.uk/index.php/openxml-power-point-templates-processing/#comment-576
每天都这么好。您只需要从google library name下载一个库: DocumentFormat.OpenXml.dll
我对此也很困惑,只是下载并链接到您的项目PowerPointTemplate(),而不是在intellisense中显示,因为它应该在OpenXml中。如果可能的话,请打开dotnet geek链接了解更多这是您的代码,因为它在您的IDE中(例如Visual Studio)?因为from
var temp=new PowerPointTemplate()代码>以后,代码不在类或成员中,这将解释您的错误。作为dotnet极客链接,人们已经执行了此代码。但是我面临着这个错误,因为缺少格式、动词和标点符号,这让我很困惑。是的。我的意思是一切都很简单。您需要安装DocumentFormat.OpenXml.dll。