home *** CD-ROM | disk | FTP | other *** search
- Listing one
- Public Sub ListEuroFonts()
-
- Dim vntFont As Variant
- Dim intCount As Integer
-
- Let intCount = 1
-
- 'List all the fonts
-
- For Each vntFont In FontNames
-
- With Selection
- .TypeText intCount
- .TypeText Chr(9)
- .Font.Name = vntFont
- .TypeText Chr(128)
- .TypeText Chr(9)
- .TypeText vntFont
- .TypeText Chr(9)
- .Font.Name = "Courier New"
- .TypeText vntFont
- .TypeText Chr(13)
- End With
-
- Let intCount = intCount + 1
- Next vntFont
-
- 'Select the whole document
- Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
-
- 'Convert to a table
- Selection.ConvertToTable Separator:=wdSeparateByTabs, _
- NumColumns:=4, NumRows:=intCount - 1, _
- Format:=wdTableFormatNone, ApplyBorders:=True, _
- ApplyShading:=True, ApplyFont:=True, _
- ApplyColor:=True, ApplyHeadingRows:=True, _
- ApplyLastRow:=False, ApplyFirstColumn:=True, _
- ApplyLastColumn:=False, Autofit:=True
-
- 'Sort the table
- Selection.Sort ExcludeHeader:=False, _
- FieldNumber:="Column 4", _
- SortFieldType:=wdSortFieldAlphanumeric, _
- SortOrder:=wdSortOrderAscending, _
- Separator:= wdSortSeparateByTabs, _
- SortColumn:=False, _
- CaseSensitive:=False, _
- LanguageID:=wdEnglishUK
-
- 'AutoFit to Contents
- Selection.Tables(1).AutoFormat _
- Format:=wdTableFormatSimple1, _
- ApplyBorders:=False, ApplyShading:=False, _
- ApplyFont:=False, ApplyColor:=False, _
- ApplyHeadingRows:=False, ApplyLastRow:=False, _
- ApplyFirstColumn:=False, ApplyLastColumn:=False, _
- Autofit:=True
-
- 'Go to the beginning
- Selection.HomeKey Unit:=wdStory
- End Sub
-
- Listing two
- Sub OneBecomesTwo()
-
- With ActiveWindow.Selection
- .Cut
-
- With .SlideRange
- .Layout = ppLayoutTwoColumnText
- .Shapes(3).Select
- End With
-
- With .ShapeRange.TextFrame.TextRange
- .Select
- .Characters(Start:=1, Length:=0).Select
- End With
-
- ActiveWindow.View.Paste
- .Unselect
- End With
-
- End Sub
-
- Sub TwoBecomeOne()
-
- With ActiveWindow.Selection
- .SlideRange.Shapes(3).Select
-
- With .ShapeRange.TextFrame.TextRange
- .Select
- .Characters(Start:=1, Length:=.Length).Select
- End With
-
- .Cut
-
- With .SlideRange
- .Layout = ppLayoutText
- .Shapes(2).Select
- End With
-
- With .ShapeRange.TextFrame.TextRange
- .Select
- .Characters(Start:=.Length, Length:=0).Select
- .InsertAfter Chr$(CharCode:=13)
- End With
-
- With .ShapeRange.TextFrame.TextRange
- .Characters(Start:=.Length, Length:=0).Select
- .InsertAfter.Paste
- End With
-
- .Unselect
- End With
-
- End Sub
-
-