Buonasera a tutti.
Sto provando a manipolare un presentazione powerpoint tramite aspnet.
La pagina aspx lanciata sul browser non dà errori ma il file powerpoint 'temp.ppt' non viene salvato nella cartella 'public', cioè rimane nella versione iniziale.
Cosa sbaglio?
codice:<%@ Page Title="Home page" Language="C#" AutoEventWireup="true" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.Odbc" %> <%@ Import Namespace="System.Configuration" %> <%@ Import Namespace="System.Security.Principal" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Runtime.InteropServices" %> <%@ Import Namespace="Microsoft.Office.Interop.PowerPoint" %> <%@ Import Namespace="Microsoft.Office.Core" %> .... <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { OdbcConnection myConnectionString = new OdbcConnection(ConfigurationManager.ConnectionStrings["ConnMySQL"].ConnectionString); try { myConnectionString.Open(); string FilePPTDaSalvare = @"D:\\Inetpub\\wwwroot\\public\\temp.ppt"; Microsoft.Office.Interop.PowerPoint.Application pptApp = new Microsoft.Office.Interop.PowerPoint.Application(); Microsoft.Office.Core.MsoTriState ofalse = Microsoft.Office.Core.MsoTriState.msoFalse; Microsoft.Office.Core.MsoTriState otrue = Microsoft.Office.Core.MsoTriState.msoTrue; pptApp.Visible = otrue; pptApp.Activate(); Microsoft.Office.Interop.PowerPoint.Presentations ps = pptApp.Presentations; Microsoft.Office.Interop.PowerPoint.Presentation p = ps.Open(FilePPTDaSalvare, ofalse, ofalse, otrue); p.SaveAs(FilePPTDaSalvare, PpSaveAsFileType.ppSaveAsPresentation, MsoTriState.msoTrue); System.Diagnostics.Debug.Print(p.Windows.Count.ToString()); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { myConnectionString.Close(); myConnectionString.Dispose(); } } </script>

Rispondi quotando