Hallo Robert,
anbei ein StĂĽck Quelltext:
- Code: Alles auswählen
wdBookmark := -1;
FilenameOfDocument := 'C:\datenbanken\Test.DOC'; //Vollständiger Name des Word-Dokumentes
FilenameOfPicture := 'C:\Datenbanken\FMB.BMP'; //Vollständiger Name der Bild-datei
NameOfBookmark := 'M1'; //Name der Textmarke, bei der Bild eingefĂĽgt werden soll
CREATE(wrdApp);
wrdApp.Visible := TRUE;
wrdDocuments := wrdApp.Documents;
wrdDocument := wrdDocuments.Open(FilenameOfDocument);
wrdBookmarks := wrdDocument.Bookmarks;
wrdBookmark := wrdBookmarks.Item(NameOfBookmark);
wrdBookmark.Select;
wrdSelection := wrdApp.Selection;
wrdInlineShapes := wrdSelection.InlineShapes;
wrdInlineShape := wrdInlineShapes.AddPicture(FilenameOfPicture);
und die Definitionen:
Name DataType Subtype Length
wrdApp Automation 'Microsoft Word 9.0 Object Library'.Application
wrdDocuments Automation 'Microsoft Word 9.0 Object Library'.Documents
wrdDocument Automation 'Microsoft Word 9.0 Object Library'.Document
wrdBookmarks Automation 'Microsoft Word 9.0 Object Library'.Bookmarks
wrdBookmark Automation 'Microsoft Word 9.0 Object Library'.Bookmark
wrdSelection Automation 'Microsoft Word 9.0 Object Library'.Selection
wrdInlineShapes Automation 'Microsoft Word 9.0 Object Library'.InlineShapes
wrdInlineShape Automation 'Microsoft Word 9.0 Object Library'.InlineShape
wdBookmark Integer
FilenameOfDocument Text 250
FilenameOfPicture Text 250
NameOfBookmark Text 30
I Integer
Damit wird einer Textmarke ein Bild aus einer datei hinzugefĂĽgt.
Auf PrĂĽfungen usw. wurde verzichtet.
Ich hoffe, Du kannst was damit anfangen.
Viele GrĂĽsse aus Leipzig von
FraMi.
EDIT : Bitte Codetags benutzen (Rautensymbol) GruĂź Kai