跳到主要内容

如何将多行合并或合并到Word文档的单个段落中?

如果您的Word文档中有成千上万的段落,则在打印此文档时,将需要大量纸张。 为了节省纸张,可以将这些多行合并为一个段落。 但是,如何在Word文档中快速,轻松地将所有这些行组合为一个段落?

使用查找和替换功能将多行合并或合并为一个段落

使用VBA代码将多行合并或合并为一个段落


使用查找和替换功能将多行合并或合并为一个段落

查找和替换 Word中的函数可以帮助您将多行合并为一个段落,请执行以下操作:

1。 选择要合并为一个段落的段落。

2。 然后,单击 主页 > 找到最适合您的地方 > 高级查找查找和替换 对话框中 查找和替换 对话框中的 找到最适合您的地方 标签,请输入 ^p查找内容 文本框,然后选择 当前选择 选项从 查找 下拉列表,请参见屏幕截图:

doc合并多行1

3。 然后去看看 更换 标签,然后离开 更换 文本框为空,然后单击 “全部替换” 按钮,请参见屏幕截图:

doc合并多行2

4。 并且所有选定的段落已合并为一个段落,请参见屏幕截图:

doc合并多行3


使用VBA代码将多行合并或合并为一个段落

这是另一个有用的方法,也可以帮助您完成Word中的这项工作,请执行以下步骤:

1。 选择要合并为一个段落的行。

2。 然后,按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。

3。 然后,单击 插页 > 模块,将以下代码复制并粘贴到打开的空白模块中。

VBA代码:将多行合并为一个段落:

Sub CleanUpPastedText()
    Dim xSelection As Selection
    On Error Resume Next
    Application.ScreenUpdating = False
Set xSelection = Application.Selection
    If xSelection.Type <> wdSelectionIP Then
        FindAndReplace xSelection
    Else
      If MsgBox("Do you want to merge all selected lines into one paragraph?", vbYesNo + vbInformation, "Kutools for Word") = vbNo Then Exit Sub
      xSelection.WholeStory
      Set xSelection = Application.Selection
      xSelection.HomeKey wdStory
      FindAndReplace xSelection
    End If
    Application.ScreenUpdating = True
    Application.ScreenRefresh
    MsgBox "The selected lines have been merged into one paragraph.", vbInformation, "Kutools for Word"
End Sub
Sub FindAndReplace(Sel As Selection)
    With Sel.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
        .Text = "[^s^t]{1,}^13"
        .Replacement.Text = "^p"
        .Execute Replace:=wdReplaceAll
        .Text = "([!^13])([^13])([!^13])"
        .Replacement.Text = "\1\3"
        .Execute Replace:=wdReplaceAll
        .Text = "[ ]{2,}"
        .Replacement.Text = " "
        .Execute Replace:=wdReplaceAll
        .Text = "([a-z])-[ ]{1,}([a-z])"
        .Replacement.Text = "\1\2"
        .Execute Replace:=wdReplaceAll
        .Text = "[^13]{1,}"
        .Replacement.Text = "^p"
        .Execute Replace:=wdReplaceAll
    End With
End Sub

4。 然后按 F5 键以运行此代码,并且所有选定的段落都已合并为一个段落,如以下屏幕截图所示:

doc合并多行4

最佳办公生产力工具

Kutools for Word - 通过 Over 提升您的文字体验 100 显着特点!

🤖 Kutools 人工智能助手:用人工智能改变你的写作 - 生成内容  /  重写文本  /  总结文件  /  查询资料 基于文档,全部在Word中

📘 文档掌握: 分页  /  合并文件  /  以各种格式导出选择(PDF/TXT/DOC/HTML...)  /  批量转换为PDF  /  将页面导出为图像  /  一次打印多个文件...

内容编辑: 批量查找和替换 跨多个文件  /  调整所有图片的大小  /  转置表行和列  /  将表格转换为文字...

🧹 轻松清洁: 移开 多余的空间  /  分节符  /  所有标题  /  文本框  /  超链接  / 如需更多拆卸工具,请前往我们的 删除组...

创意插入: 插 千位分隔符  /  复选框  /  单选按钮  /  扫码支付  /  条码  /  对角线表  /  公式标题  /  图片说明  /  表标题  /  多张图片  / 发现更多 插入组...

🔍 精准选择:精确定位 特定页面  /    /  形状  /  标题段落  / 增强导航功能 更多 选择功能...

星级增强: 快速导航至任何位置  /  自动插入重复文本  /  在文档窗口之间无缝切换  /  11 转换工具...

👉 想尝试这些功能吗? Kutools for Word 提供了 60-day免费试用,没有任何限制! 🚀
 
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
La menor evaluada, da como resultado una conducta represiva, pasiva-agresiva y primitiva, es muy energética y tolera al medio que le rodea, es una adolescente extrovertida, es algo insegura y suele tener problemas emocionales.
Da también, el resultado de ser indiferente y esto le ocasiona miedo, es rebelde en relación madre-hija, negativa en ocasiones y tiene inmadurez psicosexual.

La menor evaluada tiene la necesidad de ser reconocida y mostrarse ante su sociedad. Para ello suele ocupar el espacio personal, no con el propósito de llamar la atención sino para que se den cuenta que existe.
Es emotiva y sensible, ama su tranquilidad, peros se reprime ante algún suceso. Siente presión ante sus figuras paternas, ante eso le suele generar estrés, agobia miento y depresión, lo que se asume como la pérdida de confianza a sí misma. Lo que resalta teniendo problemas con su identidad.
This comment was minimized by the moderator on the site
Thank you very much, you saved my time a lot! another issue is that all sentences merged together in one praragraph without any SPACE between before and after sentences! how can i put an SPACE between before/after sentences in this way? please help me if there is any solution.
This comment was minimized by the moderator on the site
Hello, SALSEN,

If you need to add a space before each merged sentence, simply enter a space in the Replace text box, and then apply the replace operation.

Please have a try, thank you!
This comment was minimized by the moderator on the site
American Motors Concord 1978-1979 2.0LTS, American Motors Gremlin 1977-1978, American Motors Spirit 1979 2.0LTS 4L
Audi 100 1970-1971, Audi 100 1972-1977 1.9LTS 4L
Audi 100 1989-1991 2.3LTS 5L
Audi 100 1992-1994 2.8LTS 6V
Audi 200 1989 2.2LTS 5L
Audi 200 1990-1991 2.2LTS TURBO 5L
Audi 4000 1980
Audi 4000 1980-1987
Audi 4000 1981-1983
Audi 4000 1984-1987
Audi 5000 1978-1988
Audi 5000 1987-1988
Audi 80 1988-1990
Audi 80 1988-1989
Audi 80 1991-1992
Audi 90 1988-1992
Audi 90 1988-1992 2.3LTS 5L
Audi 90 1993-1995 2.8LTS 6V
Audi A3 1997-2005 1.8LTS TURBO 4L
Audi A3 2008-2009 1.8LTS TURBO 4L
Audi A3 1997 2.0LTS DIESEL TURBO 5L
Audi A3 2004 2.0LTS 4L
Audi A3 2005-2006 2.0LTS MEX 4L
Audi A4 1995-1997 1.8LTS TURBO 4L
Audi A6 1995 2.8LTS 6V
Audi A6 1995 2.8LTS MOTOR:AFC 6V
Audi Cabriolet 1994-1995 2.8LTS 6V
Audi Coupe 1981-1987 2.2LTS 5L
Audi Coupe 1987-1991 2.3LTS 5L
Audi Fox 1973-1974 1.5LTS 4L
Audi Fox 1975-1979 1.6LTS 4L
Audi Quattro 1983-1986 2.2LTS 5L
Audi Rs6 2003-2004 4.2LTS 8V
Audi S3 2000-2004 1.8LTS 4L
Audi S4 1992-1994 2.2LTS TURBO 5L
Audi S6 1995 2.2LTS TURBO 5L
Audi S6 1996-1997 2.2LTS 5L
Audi Tt 2000-2006 1.8LTS TURBO 4L
Bmw 325 1986-1988 2.7LTS 6L
Bmw 325E 1984-1987 2.7LTS 6L
Bmw 325Es 1986-1987 2.7LTS 6L
Bmw 325I 1987-1992 2.5LTS 6L
Bmw 325Is 1987-1991 2.5LTS 6L
Bmw 325Ix 1988-1991 2.5LTS 6L
Bmw 525I 1989-1990 2.5LTS 6L
Bmw 528E 1982-1988 2.7LTS 6L
Lotus Elan 1968-1975 1.6LTS 4L
Pontiac Sunrunner 1995-1997 1.6LTS 4L
Porsche 924 1977-1982 2.0LTS 4L
Seat Alhambra 1996-2000 2.0LTS 4L
Seat Alhambra 2002-2003 1.8LTS MEX 4L
Seat Alhambra 2004-2007 1.8LTS TURBO 4L
Seat Alhambra 2004-2005 2.8LTS 6V
Seat Altea 2004-2015 1.6LTS 4L
Seat Cordoba 2001-2002 1.6LTS MEX 4L
Seat Cordoba 2003-2004 2.0LTS MEX 4L
Seat Cordoba 2005-2009 1.6LTS 4L
Seat Cordoba 2005-2009 2.0LTS 4L
Seat Ibiza 2001-2002 1.6LTS MEX 4L
Seat Ibiza 2003-2012 2.0LTS 4L
Seat Ibiza 2004-2012 1.6LTS 4L
Seat Ibiza 2006 1.8LTS 4L
Seat Ibiza 2007 1.8LTS TURBO 4L
Seat Ibiza 2008 1.8LTS TURBO MEX 4L
Seat Leon 2001-2004 1.8LTS MEX 4L
Seat Leon 2001-2004 1.8LTS TURBO MEX 4L
Seat Leon 2005-2006 1.8LTS 4L
Seat Leon 2006 2.0LTS 4L
Seat Toledo 2001-2003 1.8LTS MEX 4L
Seat Toledo 2001-2003 1.8LTS TURBO MEX 4L
Seat Toledo 2004-2005 1.8LTS 4L
Seat Toledo 2006 2.0LTS 4L
Toyota Hiace 1977-1979 2.0LTS 4L
Toyota Hilux 1975-1989 2.0LTS 4L
Toyota Hilux 1990-1993 1.8LTS 4L
Volkswagen Atlantic 1981-1982 1.6LTS 4L
Volkswagen Atlantic 1982-1987 1.8LTS 4L
Volkswagen Beetle 1998-2011 2.0LTS 4L
Volkswagen Beetle 1999-2005 1.8LTS TURBO 4L
Volkswagen Cabrio 1995-2002 2.0LTS 4L
Volkswagen Cabriolet 1985-1993 1.8LTS 4L
Volkswagen Caddy 1982 1.5LTS 4L
Volkswagen Caddy 1993-1994 1.8LTS 4L
Volkswagen Caribe 1982-1987 1.8LTS 4L
Volkswagen Combi 1990-2001 1.8LTS 4L
Volkswagen Combi 1997 2.8LTS 6 Cil
Volkswagen Corrado 1990-1992 1.8LTS SUPERCARGADO 4L
Volkswagen Corsar 1984-1988 1.8LTS 4L
Volkswagen Dasher 1974-1975 1.5LTS 4L
Volkswagen Dasher 1976-1980 1.6LTS 4L
Volkswagen Derby 1994-2009 1.8LTS 4L
Volkswagen Derby 2001-2004 2.0LTS MEX 4L
Volkswagen Fox 1987-1993 1.8LTS 4L
Volkswagen Golf 1985-2006 1.8LTS 4L
Volkswagen Golf 1990-2010 2.0LTS 4L
Volkswagen Jetta 1980 1.6LTS 4L
Volkswagen Jetta 1981-1984 1.7LTS 4L
Volkswagen Jetta 1984-1999 1.8LTS 4L
Volkswagen Jetta 1990-2005 2.0LTS 4L
Volkswagen Jetta 2012-2013 2.0LTS 4L
Volkswagen Jetta 2001-2005 1.8LTS TURBO 4L
Volkswagen Jetta 2009-2012 1.8LTS TURBO 4L
Volkswagen Jetta 2006-2008 2.0LTS MEX 4L
Volkswagen Jetta 2011-2014 2.0LTS MOTOR:CBPA 4L
Volkswagen Jetta Clasico 2011-2015 2.0LTS 4L
Volkswagen Passat 1990-1997 2.0LTS 4L
Volkswagen Passat 1993 1.8LTS 4L
Volkswagen Passat 2001 2.8LTS MOTOR:ATQ 6V
Volkswagen Pointer 1998-2009 1.8LTS 4L
Volkswagen Pointer Pickup 1999-2009 1.8LTS 4L
Volkswagen Polo 2003-2007 2.0LTS 4L
Volkswagen Quantum 1982-1983 1.7LTS 4L
Volkswagen Quantum 1983-1988 2.2LTS 5L
Volkswagen Quantum 1984-1985 1.8LTS 4L
Volkswagen Rabbit 1975-1980 1.5LTS 4L
Volkswagen Rabbit 1976-1980 1.6LTS 4L
Volkswagen Rabbit 1981-1984 1.7LTS 4L
Volkswagen Rabbit 1983-1984 1.8LTS 4L
Volkswagen Rabbit Convertible 1980 1.6LTS 4L
Volkswagen Rabbit Convertible 1981-1983 1.7LTS 4L
Volkswagen Rabbit Convertible 1984 1.8LTS 4L
Volkswagen Rabbit Pickup 1980 1.5LTS 4L
Volkswagen Rabbit Pickup 1980 1.6LTS 4L
Volkswagen Rabbit Pickup 1981-1983 1.7LTS 4L
Volkswagen Scirocco 1975-1978 1.5LTS 4L
Volkswagen Scirocco 1976-1980 1.6LTS 4L
Volkswagen Scirocco 1981-1983 1.7LTS 4L
Volkswagen Scirocco 1984-1989 1.8LTS 4L
Volkswagen Sedan 1978-1979 1.6LTS 4H
Volkswagen Sedan 1993-2003 1.6LTS 4L
Volkswagen Sharan 2002-2008 1.8LTS TURBO 4L
Volkswagen Super Beetle 1978-1980 1.6LTS 4H
Volkswagen Transporter 1985 1.9LTS DIESEL 4L
Volkswagen Transporter 1986-1991 2.1LTS 4H
Volkswagen Transporter 1990-1992 1.8LTS 4L
Volkswagen Transporter 1990-1993 2.0LTS 4L
Volkswagen Van 2003-2008
Volkswagen Vanagon 1983-1985
Volkswagen Vanagon 1986-1989
Volkswagen Vanagon 1990-1991
This comment was minimized by the moderator on the site
excelente, me salvaste la vida.
This comment was minimized by the moderator on the site
Thanks mate
This comment was minimized by the moderator on the site
First step, that I have tested, is brilliant enough. It was the best trick I have heard about. Thank you!
This comment was minimized by the moderator on the site
Thank you! This saved me hours from having to individually collapse 70+ pages of several broken sentences into paragraphs. This is GENIUS.
This comment was minimized by the moderator on the site
is there a way to make this word on google docs, I did the steps but this will only work for the desktop and online versions of microsoft word
This comment was minimized by the moderator on the site
Thank you very much
This helps me to save time I was doing this manually, was 60 pages after 2 pages I get tired and start looking other shortcut
THANKS
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations