![]() |
|
|
|
#1
|
|||
|
|||
|
Dear all, i have the follow problem:
I have to cancel the blanc spaces at the beginnig row (and only at the beginning row) from a Word file but only from row "x" to row "y". Do you have any solution? Ex: i would like to eliminate 6 or 7 blanc spaces for every rows from row 8 to row 25. |
|
#2
|
|||
|
|||
|
Something Could help me please?
|
|
#3
|
||||
|
||||
|
Could you post an example file for us to look at - and please mark the areas that should be removed, thanks.
This way, more people may have a go at answering. |
|
#4
|
|||
|
|||
|
I have posted an example and i have marked the area that i have to remove.
The letter are about 120 and i would have a procedure. Help me...please!!! Thanks |
|
#5
|
||||
|
||||
|
OK - what you are going to need to do is create a macro that uses the Find and Replace tool that loops through the document.
The following code will: Find "_______" and remove it. This will go through the whole document. Code:
Find_and_replace_spaces Macro
' Macro recorded 6/24/2009 by Bird_FAT
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "_______"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Loop
End Sub
|
|
#6
|
|||
|
|||
|
Thank you for your collaboration but this isn't the solution. Maybe my english isn't correct.
I post the input file and the output file that would have to obtain! The macro that you have wrote cancel all blanc spaces. I post also the result for your macro. The macro have to cancel only blanc spaces on the left of input document in specific area form "PROTOCOLLO" to "DISTINTI SALUTI". Do you have another solution? |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Eliminate paragraph breaks
|
geobruin | Word | 1 | 06-12-2009 06:55 AM |
| Spaces After Each Word | jnutella | Word | 0 | 03-04-2009 02:00 PM |
How to eliminate Header on Contents Page
|
George99 | Word | 1 | 12-06-2008 09:59 AM |
| Word to Excel hyperlinks and spaces | gak | Word | 1 | 09-14-2008 08:38 AM |
| protected form with underline fillable spaces | rohitsahib | Word | 0 | 02-02-2006 10:22 AM |