Microsoft Office Tutorials and References
In Depth Information
Splitting a Document into Multiple Files
bFound = .Execute¶
End With¶
If bFound Then¶
rngSearch.Select¶
Set rngSearch = doc.Bookmarks( _¶
"\HeadingLevel").Range¶
'Sub docs can't go across¶
'section / subdoc boundaries¶
Do While Asc(rngSearch.Characters( _¶
Len(rngSearch.Text))) = 12¶
rngSearch.MoveEnd wdCharacter, -1¶
Loop¶
doc.Subdocuments.AddFromRange _¶
rngSearch¶
End If¶
rngSearch.Collapse wdCollapseEnd¶
rngSearch.MoveStart wdCharacter, 1¶
rngSearch.End = doc.Range.End¶
rngSearch.Select¶
Loop While bFound¶
Next¶
End Sub¶
' * * * * *¶
Function GetStyleName(doc As Word.Document, _¶
outlineLevel As Long) As String¶
'Variable declaration¶
Dim styleName As String¶
Select Case outlineLevel¶
Case 1¶
styleName = doc.Styles(wdStyleHeading1).NameLocal¶
Case 2¶
styleName = doc.Styles(wdStyleHeading2).NameLocal¶
Case 3¶
styleName = doc.Styles(wdStyleHeading3).NameLocal¶
Case 4¶
styleName = doc.Styles(wdStyleHeading4).NameLocal¶
Case 5¶
styleName = doc.Styles(wdStyleHeading5).NameLocal¶
Case 6¶
styleName = doc.Styles(wdStyleHeading6).NameLocal¶
Case 7¶
styleName = doc.Styles(wdStyleHeading7).NameLocal¶
Case 8¶
styleName = doc.Styles(wdStyleHeading8).NameLocal¶
Case 9¶
styleName = doc.Styles(wdStyleHeading9).NameLocal¶
End Select¶
GetStyleName = styleName¶
End Function¶
Wrd
Search JabSto ::




Custom Search