Einzelnen Beitrag anzeigen

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