Pages

20140219

Word Macro

Useful for creating paper-sized tags for shelves, etc.

Name:  PaperTags
What it does:
- Asks how many you need
- Sets up page for landscape orientation
- Centers horizontally and vertically
- Begins sequence...
- Makes fontsize 200
- Places A followed by the sequence number on the page
- Changes fontsize to 1
- Places a return
- Creates a page break
- Repeats from the fontsize part until done with sequence

Sub PaperTags()
'
' PaperTags Macro
'
'
Dim strCount As String
Dim lngCount As Long
Dim lngCycle As Long
strCount = InputBox("How many times to repeat?")
lngCount = strCount

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    With ActiveDocument.PageSetup
        .VerticalAlignment = wdAlignVerticalCenter
    End With
    If Selection.PageSetup.Orientation = wdOrientPortrait Then
        Selection.PageSetup.Orientation = wdOrientLandscape
    Else
        Selection.PageSetup.Orientation = wdOrientPortrait
    End If
For lngCycle = 1 To lngCount
    Selection.Font.Size = 200
    Selection.TypeText Text:="A" & lngCycle
    Selection.Font.Size = 1
    Selection.TypeParagraph
    Selection.InsertBreak Type:=wdPageBreak
Next lngCycle

End Sub

No comments: