Consulting

Results 1 to 4 of 4

Thread: Is this section incorrect?

  1. #1
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location

    Is this section incorrect?

    I was searching Microsofts VBA examples when I came across this explanation and its accompanying section of code. Is the code not saying that if the space is 12 point then change it to 6 points which is contrary to the supplied explanation.

    This example loops through all of the paragraphs in the active document. If the space-before setting for a paragraph is 6 points, this example changes the spacing to 12 points
    Sub LoopParagraphs() 
    Dim parCount As Paragraph 
    For Each parCount In ActiveDocument.Paragraphs 
        If parCount.SpaceBefore = 12 Then parCount.SpaceBefore = 6 
    Next parCount 
    End Sub

    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  2. #2
    VBAX Regular
    Joined
    Jan 2022
    Posts
    16
    Location
    Another good example of human (Microsoft staff's) imperfection.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    It brings into question other sections of code that they promote as a learning tool.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  4. #4
    VBAX Regular
    Joined
    Jan 2022
    Posts
    16
    Location
    I think, sometimes it's helpful to doubt and check the general truth or experts' statements. It may be a way to a discovery.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •