
Tips.Net > WordTips Home > Formatting > Tabs and Tab Stops > Removing Tabs Used to Indent a Paragraph with WordBasic
Summary: An easy little WordBasic macro to strip tabs from the beginning of a paragraph. (This tip works with Microsoft Word 6, and Word 95.)
If you frequently convert documents from a different word processor to Word, there is a good chance you must remove tabs inserted at the beginning of paragraphs. Some word processors require tabs in order to indent the first line of a paragraph; Word does not.
About the only way to remove the unnecessary tabs is to go to the beginning of each of the paragraphs and press the Del key. You could, however, use the Replace option from the Edit menu in order to search for tabs and remove them. (Actually, you would search for a paragraph mark followed by a tab; this would then be replaced with a paragraph, thereby deleting the tab.)
A quicker way to take care of this problem is to develop a macro to do it for you. The following macro, TabsOut, searches for any hard return/tab combinations in your document (or your selected text) and removes the tab.
Sub MAIN
InSelection = SelType()
If InSelection = 1 Or InSelection = 5 Then
StartOfDocument
End If
EditFindClearFormatting
EditReplaceClearFormatting
EditReplace .Find = "^p^t", .Replace = "^p", \
.WholeWord = 0, .MatchCase = 0, .Format = 0, \
.ReplaceAll = 1
End Sub
Tip #1173 applies to Microsoft Word versions: 6 95
Save Time! WordTips has been published weekly since early 1997. Past issues are available in convenient WordTips archives. Have your own enhanced archive of WordTips at your fingertips, available to use at any time!
Check out WordTips Archives today!
If you provide support and help to others, you need the power offered in the WordTips Ten-Year Library. There is no better information repository anywhere! (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips