|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Sub udfStyleListNum2()
' Procedure : cmd_StyleListNum2
' Description: Apply style "List Number 2" to the current paragraph. Adapt parent indentation.
' Copyright: Chris Greaves Inc.
' Inputs: None
' Returns: None
' Assumes: Nothing
' Side Effects: The current paragraph formatting may change.
' Tested: By a callf rom the user.
Selection.Style = ActiveDocument.Styles("List Number 2") ' set the style
With Selection.Paragraphs(1).Range ' go back one paragraph
.Collapse Direction:=wdCollapseStart
.Move Unit:=wdParagraph, Count:=-1
.Select
End With
Dim sngleftIndent As Single
sngleftIndent = Selection.ParagraphFormat.LeftIndent ' obtain parent indentation
Selection.MoveDown Unit:=wdParagraph, Count:=1 ' go forward 1 paragraph
Selection.ParagraphFormat.LeftIndent = sngleftIndent ' apply parent indentation
End Sub
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |