If you want to change the default line spacing in Word 2007 or Word 2010, or learn how to set the line spacing in a single document, here are the best resources we’ve found for step-by-step instructions. For documents like business letters or reports that use block-style paragraphs, there's usually a little space between each.
If a document has 12-point text, then one line space. I would also like to set the table property, "Allow row to break across pages" to False (because, seriously, the default value of True is really dumb!) and can't figure how to do that either.ĪctiveDocument.Styles("Normal").ParagraphFormat.Space1ĪctiveDocument.Styles("Normal").ParagraphFormat.SpaceAfter = 0ĪctiveDocument.Styles("Normal").ParagraphFormat.SpaceBefore = 0ĪctiveDocument.Styles("Normal").ParagraphFormat.SpaceAfterAuto = FalseĪctiveDocument.Styles("Normal").ParagraphFormat.SpaceBeforeAuto = FalseĪctiveDocument. The short answer is that the default line spacing changed in Word 2007 to make online documents more readable. You use the Paragraph dialog box to set the space between paragraphs. I tried both "With " and "With " for METHOD 3, but neither worked. I have selectively commented them out and discovered that no one of the methods works and doing all three doesn't help any. The function below actually tries all three methods.
When I do this manually after selecttables() executes, I am doing method 3. Set the values on the total selection, after all the tables are selected. Set the values for each table as they are selectedģ. Set the values globally for the Normal style (which all the tables use)Ģ. All I want to do now is set the appropriate ParagraphFormat members to mimic my setting of these properties in the Paragraph Dialog to zero and false.ġ. But like so many Word settings, that setting may contend with a competing setting set elsewhere-say, for Normal or tables. In Word 20, you can disable it by File > Option > Advanced > Layout Options. You can also change the font size used for the separator, whichif the line spacing for the paragraph is set to Autowill affect the amount of apparent space after the separator. The behavior you've described is called called HTML auto spacing. Pay particular attention to the Space After setting for the paragraph. This works fine and leaves all my tables selected. Use Words regular formatting tools to change the paragraph formatting. wdEditorEveryoneĪctiveDocument.SelectAllEditableRanges (wdEditorEveryone)ĪctiveDocument.DeleteAllEditableRanges (wdEditorEveryone) So I started with a simple select subroutine: Sub selecttables()įor Each mytable In ActiveDocument.Tables I have an exported Word document in which tables constructed by a database extractor have space between wrapped lines in cells that I can remove by selecting the table and using the paragraph dialog box, but there are many tables and I want to automate this.Īll I have to do after selecting all the tables in the document (which I can do with VBA) is set Add Space Before and Add Space After both = 0, which I think, secretly also sets the AddSpaceBeforeAuto = AddSpaceAfterAuto = False.