Einzelnen Beitrag anzeigen

Benutzerbild von p80286
p80286

Registriert seit: 28. Apr 2008
Ort: Stolberg (Rhl)
6.659 Beiträge
 
FreePascal / Lazarus
 
#13

Re: Formularkopf in Word exportieren

  Alt 10. Dez 2008, 12:48
Hallo future01,

nicht gleich die Flinte ins Korn werfen!

Ich hab's zwar nur überflogen, aber der Aufruf von word (und das Beenden) sollte wohl funktioniern.

Wenn du Textmarken füllen willst/anspringen willst, versuch's mal hiermit:
Delphi-Quellcode:
bkmkcnt:=msword.ActiveDocument.Bookmarks.count;
  if bkmkcnt>0 then begin
    try
      msword.activedocument.bookmarks.item(bookmark).select;
      msword.activedocument.selection.text:=inhalt;
    except
    end;
Wobei bookmark den Namen des bookmarks enthält (bookmark=Textmarke).

hiermit kannst du die namen der bookmarks auslesen:
Delphi-Quellcode:
type
  ll : tstringlist;
  bkmkcnt: integer;

.....
  i:=1;
  bkmkcnt:=msword.ActiveDocument.Bookmarks.count;
  ll.add(' Word-Dokument:'+msword.activedocument.name+' '+wfile);
  ll.add(' Anzahl Bookmarks:'+inttostr(bkmkcnt));
  if bkmkcnt>0 then
    repeat
      ll.add(inttostr(i)+') '+msword.activedocument.bookmarks.item(i).name);
      inc(i,1);
    until i>bkmkcnt;
Ich hoffe es hilft Dir.
Grüße
K-H
  Mit Zitat antworten Zitat