Hallo,
also
Zitat: |
For i:=0 to wDoc.StoryRanges.Count do begin
|
ist schonmal suboptimal

, da zähslt du auf alle Fälle ein Item zuviel
entweder
Delphi-Quelltext
1:
| For i:=0 to wDoc.StoryRanges.Count-1 do begin |
oder
Delphi-Quelltext
1:
| For i:=1 to wDoc.StoryRanges.Count do begin |
2. wäre für mich richtig, die items in Word fangen immer bei 1 an.
Zeig mal bitte deinen kompletten Code, also auch, wie Du dich mit Word verbindest.
ansonsten haben die Elemente meist eine item-Eigenschaft (runde Klammer!).
Du müßtest sinnbildlich sowas stehen haben:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| Var Astory,Afield:variant; For i:=1 to wDoc.StoryRanges.Count do begin astory:=wDoc.StoryRanges.item(i); for j:=1 to astory.fields.count do begin Afield:=astory.fields.item(j); afield.update; end; end; |
ist aber völlig ungetestet.
Wobei, läßt sich das aktualisieren nicht auch in den Optionen generell einstellen?
Gruß Frank