我正在製作C#應用程序從我創建powerpoint演示文稿。我想應用主題我的介紹編程。我使用下面的代碼得到主題列表。但是我怎麼能夠將它們應用到一個活躍的演示文稿?以編程方式應用Powerpoint主題
String programfilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
String msOfficePath = "Microsoft Office\\Document Themes 14";
String fullPath = Path.Combine(programfilesPath, msOfficePath);
String[] fileEntries = Directory.GetFiles(fullPath, "*.thmx", SearchOption.TopDirectoryOnly);
任何想法如何進行?
你檢查此鏈接**【如何:將主題應用於演示文稿(http://msdn.microsoft.com/en-us/library/cc850846 (v = office.14)的.aspx)**? –
耶@Pilgerstofer,我看了一下該鏈接之前,但它是沒有用的,因爲它們是從一個PowerPoint文件到另一個副本的主題。這些主題文件是存儲在我上面提到的位置中的.thmx文件。 在你已經共享的鏈接中看到這段代碼.. string presentationFile = @「C:\ Users \ Public \ Documents \ myppt2.pptx」; 串themePresentation = @」 C:\用戶\公共\文件\ myppt2-theme.pptx」; ApplyThemeToPresentation(presentationFile,themePresentation); – Pankaj