AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Winword-OLE Search&Replace

Ein Thema von hoika · begonnen am 20. Jul 2016 · letzter Beitrag vom 25. Jul 2016
 
Benutzerbild von p80286
p80286

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

AW: Winword-OLE Search&Replace

  Alt 25. Jul 2016, 10:49
ich hab da ein Makro ausgegraben, daß mir ein wenig die Struktur eines Worddokumentes analysiert:
Code:
Sub Makro2()
'
' Dokument Inhalt
'
'
With ActiveDocument
  MsgBox ("im Dokument enthaltene Shapes:" + Str(.Shapes.Count))
  For a = 1 To .Shapes.Count
   MsgBox (a + .Shapes(a).Name)
  Next
 
  MsgBox ("im Dokument enthaltene InlineShapes:" + Str(.InlineShapes.Count))
 
 
  MsgBox ("im Dokument enthaltene Sections:" + Str(.Sections.Count))
  For a = 1 To .Sections.Count
    MsgBox ("Anzahl Header" + Str(.Sections(a).Headers.Count) + " in Section" + Str(a) + Chr(13) + Chr(10) + _
            "Anzahl Footer" + Str(.Sections(a).Footers.Count) + " in Section" + Str(a))
    For b = 1 To .Sections(a).Headers.Count
      MsgBox ("Header " + Str(b) + " Anzahl Shapes " + Str(.Sections(a).Headers(b).Shapes.Count))
    Next
     
  Next
  MsgBox ("im Dokument enthaltene bookmarks: " + Str(.Bookmarks.Count))
    For a = 1 To .Bookmarks.Count
      MsgBox (Str(a) + "Bookmark Name:" + .Bookmarks(a).Name + Chr(13) + Chr(10) + _
                "Bookmark Länge:" + Str(.Bookmarks(a).Range.StoryLength))
               
               
  Next
 
 ' MsgBox ("im Dokument enthaltene FooterHeader:" + Str(.Shapes.Count))
End With 'ActiveDocument
End Sub
vielleicht hilft Dir das weiter

Gruß
K-H

da stimmt was nicht mit den codeTags??

Pardon, da war noch eine Macke drin.

Sub Makro2()
'
' Dokument Inhalt
'
'
With ActiveDocument
MsgBox ("im Dokument enthaltene Shapes:" + Str(.Shapes.Count))
For a = 1 To .Shapes.Count
MsgBox (Str(a) + .Shapes(a).Name)
Next

MsgBox ("im Dokument enthaltene InlineShapes:" + Str(.InlineShapes.Count))

MsgBox ("im Dokument enthaltene Sections:" + Str(.Sections.Count))
For a = 1 To .Sections.Count
MsgBox ("Anzahl Header" + Str(.Sections(a).Headers.Count) + " in Section" + Str(a) + Chr(13) + Chr(10) + _
"Anzahl Footer" + Str(.Sections(a).Footers.Count) + " in Section" + Str(a))
For b = 1 To .Sections(a).Headers.Count
MsgBox ("Header " + Str(b) + " Anzahl Shapes " + Str(.Sections(a).Headers(b).Shapes.Count))
Next

Next

MsgBox ("im Dokument enthaltene bookmarks: " + Str(.Bookmarks.Count))

For a = 1 To .Bookmarks.Count
MsgBox (Str(a) + "Bookmark Name:" + .Bookmarks(a).Name + Chr(13) + Chr(10) + _
"Bookmark Länge:" + Str(.Bookmarks(a).Range.StoryLength))
Next


' MsgBox ("im Dokument enthaltene FooterHeader:" + Str(.Shapes.Count))
End With 'ActiveDocument
End Sub
Programme gehorchen nicht Deinen Absichten sondern Deinen Anweisungen
R.E.D retired error detector

Geändert von p80286 (25. Jul 2016 um 10:59 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:45 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz