1.

Solve : Macro help needed - please!?

Answer»

I have a macro that I RUN on my Word documents (MS Word 2003-2007). I need to add to it so that it strips out all TABS and indents in all Word documents within a folder. Below is the macro. I know nothing about macros, so just need some advice on how to do this! Thanks!

Dim oShp As Shape
Dim oIShp As InlineShape

Dim myFile As String
MyPath = "C:\Convert\"
myFile = Dir(MyPath)

Do While myFile <> ""
If myFile LIKE "*.*" Then
Documents.Open FileName:=MyPath & myFile

For Each oShp In ActiveDocument.Shapes
oShp.Delete
Next

For Each oIShp In ActiveDocument.InlineShapes
oIShp.Delete
Next

Selection.WholeStory
Selection.Font.Name = "Courier New"
Selection.Font.Size = 12

With ActiveDocument.PageSetup
.TopMargin = InchesToPoints(1)
.BottomMargin = InchesToPoints(1)
.LeftMargin = InchesToPoints(1)
.RightMargin = InchesToPoints(1)

End With
Selection.MoveUp Unit:=wdLine, Count:=1
ActiveDocument.SaveAs FileName:=MyPath & myFile, FileFormat:=wdFormatDocument
Documents.Close (wdDoNotSaveChanges)
End If
myFile = Dir
Loop
End SubQuote from: CindyM on June 30, 2011, 01:37:38 PM

I have a macro Below is the macro. I know nothing about macros

So how did you get it?
You could try typing "Word macro remove tabs and indents" into Google... you might find stuff like this

http://word.tips.net/T001174_Removing_Tabs_Used_to_Indent_a_Paragraph.html



Discussion

No Comment Found