word根据特定文字提取当前页到另一个文档 根据文档,将包含有中级包所有文档,复制包含的一页到下一个文档,我做了一下 格式表格没有了 只有文字求大神帮忙 [backcolor=var(--im_chat_message_bg_color,#c9e7ff)]Sub 提取内容()[backcolor=var(--im_chat_message_bg_color,#c9e7ff)] Dim temp_text, text_output As String
i = 0
Do
With Selection.Find
.Text = "中级包"
.Forward = True
.Wrap = wdFindContinue
.Format = False
End With
Selection.Find.Execute
ActiveDocument.Bookmarks("\page").Range.Select
i = i + 1
text_output = text_output & Selection.Text & Chr(13)
If i = 500 Then
Exit Do
End If
Selection.EndKey Unit:=wdLine
Selection.MoveRight
Loop
Documents.Add.Content.Text = text_output
ActiveDocument.SaveAs ("H:\1.docx") '输出成独立的word文档
End Sub
[color=var(--common_level2_base_color,rgba(17,31,44,0.56))]
[backcolor=var(--common_bg_z1_color,#fff)]
[backcolor=var(--common_bg_z1_color,#fff)]
[color=var(--common_level2_base_color,rgba(17,31,44,0.56))][backcolor=var(--common_bg_z1_color,#fff)]
|