Autor Beitrag
Vitalic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Di 12.06.12 21:05 
Hallo, ich möchte gerne den Inhalt von Word als Image speichern.

Habe folgendes Beispiel gefunden, jedoch funktioniert das nur bei bereits in Word vorhandenen Bildern:
Mein Word-Dokument besteht jedoch aus Bildern und Text, daher würde ich mich über Eure Ideen freuen.


ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
        object fileName = @"C:\Documents and Settings\ErabLK\Desktop\toTest.docx";
        object val = System.Reflection.Missing.Value;
        object falseVal = false;
        Document wordDoc = wordApp.Documents.Open(ref fileName, ref val, ref falseVal, ref val, ref val,
                             ref val, ref val, ref val, ref val, ref val, ref val, ref val, ref val, ref val,
                             ref val, ref val);


        wordDoc.ActiveWindow.Selection.WholeStory();
        wordDoc.ActiveWindow.Selection.Copy();
        Image img = System.Windows.Forms.Clipboard.GetImage();


Gruß
Vitalic


Moderiert von user profile iconKha: Topic aus C# - Die Sprache verschoben am Di 12.06.2012 um 21:14