<![CDATA[Latest posts for the topic "Làm sao để xoá dòng trắng trong word"]]> /hvaonline/posts/list/23.html JForum - http://www.jforum.net Làm sao để xoá dòng trắng trong word Code:
' Xoá dòng tr?ng trong word
Sub RemoveEmptyLines0()
'
' removeemptylines Macro
'
Dim i As Long
With ActiveDocument
    Call .Range.Find.Execute(Findtext:=Chr(11), Replacewith:=" ", Replace:=wdRplaceall)
    For i = .Paragraphs.count To 1 Step -1
        If .Paragraphs(i).Range.Characters.count = 1 Then
            .Paragraphs(i).Range.Delete
        End If
Next
End With
End Sub
Code 2 Code:
Sub RemoveEmptyLines1()
  ' Loop each line, check and remove
  ' Written by W_Hat, 20060427
  
  Dim totallines As Integer
  Dim length As Integer
  Dim count As Integer
  
  Dim strLine As String
  
  ' Lay tong so' lines
  totallines = ActiveDocument.BuiltInDocumentProperties("NUMBER OF LINES")
  count = 0

  ' Ve` dau document
  Selection.HomeKey Unit:=wdStory, Extend:=wdMove
  
  ' Duyet tu`ng line
  For i = 1 To totallines
     ' Select 1 line
     ActiveDocument.Bookmarks("\LINE").Select
     
     ' Bo? va thay the cac ki tu dac biet
     strLine = Selection.Text
     
     strLine = Trim(strLine)
     strLine = Replace(strLine, vbTab, "")
     strLine = Replace(strLine, vbCrLf, "")
     strLine = Replace(strLine, Chr(13), "")
     strLine = Replace(strLine, Chr(32), "")
     ' Tinh chieu da`i line ket qua, neu line tro'ng thi` xo'a line
     length = Len(strLine)
     If length = 0 Then
       Selection.EndKey Unit:=wdLine, Extend:=wdExtend
       Selection.TypeBackspace

       count = count + 1
     Else
       ' Duyet line ke tiep
       Selection.MoveRight Unit:=wdCharacter, count:=1, Extend:=wdMove
     End If
  Next i

   MsgBox "RemoveEmptyLines finish. Total empty lines is " & count
End Sub
]]>
/hvaonline/posts/list/2719.html#15030 /hvaonline/posts/list/2719.html#15030 GMT
Làm sao để xoá dòng trắng trong word /hvaonline/posts/list/2719.html#15101 /hvaonline/posts/list/2719.html#15101 GMT