Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String strFileName;

            //Find the Office document.
            openFileDialog1.FileName = "";
            openFileDialog1.ShowDialog();
            strFileName = openFileDialog1.FileName;

            //If the user does not cancel, open the document.
            if (strFileName.Length != 0)
            {
                Preview  preview = new Preview();
                FileType ft      = new FileType("Ppt Files", "*.Ppt", typeof(PowerPointPreview), null);
                preview.DoAction(strFileName, ft, this);
            }
        }