Jens hat geschrieben:Hallo Mathis,
kannst du noch sagen, um was für Textmarken es sich dabei handelt? Meinst Du Felder, die im Word-Dokument eingefügt sind?
Gruss,
Jesn
Code: Alles auswählen.
ActiveDocument.Bookmarks("test").Select
Code: Alles auswählen.
ThisDocument.Bookmarks("test").Select
Code: Alles auswählen.
NCLUDE ole2incl .
DATA: o_word TYPE ole2_object ,
o_documents TYPE ole2_object ,
o_doc TYPE ole2_object ,
o_activedoc TYPE ole2_object,
o_bookmarks type ole2_object,
o_bookmark type ole2_object.
CREATE OBJECT o_word 'WORD.APPLICATION'.
SET PROPERTY OF o_word 'Visible' = '0' .
CALL METHOD OF o_word 'Documents' = o_documents.
CALL METHOD OF o_documents 'Open' = o_doc
EXPORTING #1 = 'D:\test.doc' .
CALL METHOD OF o_word 'ActiveDocument' = o_activedoc .
CALL METHOD of o_activedoc 'Bookmarks' = o_bookmarks.
CALL METHOD of o_bookmarks 'Select' = o_bookmark
EXPORTING #1 = 'test'.
Code: Alles auswählen.
CALL METHOD OF o_activedoc 'Bookmarks' = o_bookmark EXPORTING #1 = 'TEL'.
CALL METHOD of o_bookmark 'Select' = o_bookmark.
Code: Alles auswählen.
CREATE OBJECT h_word 'WORD.APPLICATION'.
SET PROPERTY OF h_word 'Visible' = '1' .
CALL METHOD OF h_word 'Documents' = docs.
CALL METHOD OF docs 'Open' = doc
EXPORTING #1 = 'c:\temp\test23.doc' .
CALL METHOD OF h_word 'ActiveDocument' = o_activedoc.
CALL METHOD of o_activedoc 'Activate'.
call method of o_activedoc 'Content' = o_content.
call method of o_content 'Find' = o_find.
CALL METHOD OF o_find 'Execute'
EXPORTING #01 = 'TEL'
#02 = 1
#03 = 1
#04 = 0
#05 = 0
#06 = 0
#07 = 0
#08 = 0
#09 = 0
#10 = 'Hallo'.
conmat hat geschrieben:Hallo Jens,
vielen Dank für deine Antwort, leider führt auch das noch nicht zu meinem gewollten Erfolg.
Hier mein Coding:
data: rueck type ole2_object,
create object word 'Word.Basic'.
call method of word 'AppShow'.
call method of word 'FileNew' = rueck
exporting #1 = 'c:\test'.
tmarke = 'EMAIL'.(FAX; TEL; usw.)
call method of word 'EditFind'
exporting #1 = tmarke.
p_string = adr6-smtp_addr.
call method of word 'Insert'
exporting #1 = p_string.
Textmarke EMAIL habe ich im Word unter Textmarken anlegen angelegt.
Ich möchte viele Textmarken füllen, habe das Abarbeiten der Textmarken in einem Loop hinterlegt.
Es funktioniert der einmalige Absprung zur ersten TExtmarke und auch der Insert des Textes an dieser STelle funktioniert, allerdings nur bei der ersten Textmarke, ab da schreibt er alles untereinander.
Siehe Beispiel Ausdruck
Tel./Fax/E-Mail
+49 7731 80-TEL / 80-FAX /
6361
Coiver Contract Srl
Cormano (MI)
Via Bizzozzero, 93
2089
MATHIS
Die 6361 z.B müsste er an die Textmarke FAX schreiben.
Dein Coding hab ich zwar eingebaut komm jedoch auch zu keinem anderen Ergebnis.
Vielleicht hast noch eine Idee, wenn du mein Coding siehst, bzw. erkennst vielleicht meinen Fehler, den
ich evtl. mache.
Vielen Dank.
Gruß
Conny