技術(shù) 點(diǎn)
- 技術(shù)
- 點(diǎn)
- V幣
- 點(diǎn)
- 積分
- 32705
|
打開(kāi)WROD 文本
將WORD 文本現(xiàn)有內(nèi)容刪除
拷貝文本51 內(nèi)容到WORD 文本
問(wèn)題:
如何判斷該WORD 文件是否打開(kāi), 是則不在打開(kāi),直接轉(zhuǎn)到該WORD 文檔
多次打開(kāi)關(guān)閉后
intI = ActiveDocument.Paragraphs.Count
出現(xiàn)問(wèn)題,
如何優(yōu)化
Dim oApp As Word.Application
Dim myRange As Range
Dim intI As Integer
'
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open MyPath
intI = ActiveDocument.Paragraphs.Count
Set myRange = ActiveDocument.Range(Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(intI).Range.End)
myRange.Delete
myRange.InsertAfter Me.文本51 |
|