NetOffice.NetOfficeException: 'Factory is not initialized with NetOffice assemblies.'
i make ppt to png , jpg converter
this code worked in microsoft.interop.powerpoint
win10, WPF , c# , .net framework 4.5 ,nuget is 4.5 powerpoint and netoffice core
this my code
`using NetOffice.OfficeApi.Enums;
using NetOffice.PowerPointApi;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PPTConverter2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlgOpenFile = new OpenFileDialog();
dlgOpenFile.Filter = "Image Files (*.ppt, *.pptx) | *.ppt; *.pptx; | All files (*.*) | *.*";
if (dlgOpenFile.ShowDialog().ToString() == "OK")
{
textBox1.Text = dlgOpenFile.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
FileInfo File_Check = new FileInfo(textBox1.Text);
if (File_Check.Exists)
{
NetOffice.PowerPointApi.Application app =
new NetOffice.PowerPointApi.Application();
Presentation ppt = app.Presentations.Open(textBox1.Text
, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
for (int i = 0; i < ppt.Slides.Count; ++i)
{
//error is occured here
ppt.Slides[i + 1].Export(docPath + "/" + i + ".png", "PNG",
(int)ppt.Slides[i + 1].Master.Width,
(int)ppt.Slides[i + 1].Master.Height);
}
ppt.Close();
app.Quit();
MessageBox.Show("Sucees");
}
else
{
MessageBox.Show("wrong path");
return;
}`
NetOffice.NetOfficeException: 'Factory is not initialized with NetOffice assemblies.'
i make ppt to png , jpg converter
this code worked in microsoft.interop.powerpoint win10, WPF , c# , .net framework 4.5 ,nuget is 4.5 powerpoint and netoffice core this my code
`using NetOffice.OfficeApi.Enums; using NetOffice.PowerPointApi; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace PPTConverter2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }