PDA

View Full Version : Is this section incorrect?



Aussiebear
01-20-2024, 05:07 AM
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

Vladimir
01-20-2024, 03:00 PM
Another good example of human (Microsoft staff's) imperfection. :)

Aussiebear
01-20-2024, 08:58 PM
It brings into question other sections of code that they promote as a learning tool.

Vladimir
01-21-2024, 02:32 AM
I think, sometimes it's helpful to doubt and check the general truth or experts' statements. It may be a way to a discovery.