從下面的代碼TCN.docx
文件已經使用成功打開如何打開word文檔並在其中查找文本而不顯示文檔?
Application.ScreenUpdating = False
代替
Visible:= False
Sub workonTCN()
Dim odoc As Document
Dim path As String
path = "C:\Users\Bilal\Desktop\TCN.docx"
Set odoc = Documents.Open(filename:=path)
Application.ScreenUpdating = False
Selection.Find.ClearFormatting
Selection.Find.Font.Bold = True
With Selection.Find
.Text = "TI"
.Forward = True
.Wrap = wdFindStop
.Format = True
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
Selection.MoveRight Unit:=wdCell
Selection.COPY
Else
End If
Windows("ROUGH").Activate
odoc.Close wdDoNotSaveChanges
Selection.PasteAndFormat (wdPasteDefault)
End sub
我如何申請範圍內找到的文本,而不Selection.Find
?
'application.screenupdating = false'? – findwindow
'但找到函數不工作,直到我使TCN.Docx可見:= true'你確定嗎?我認爲這應該工作。 – newguy
但我需要tcn.docx可見:= flase –