小编raf*_*pmx的帖子

如何在Word VBA中获取指定文本的段落号?

我需要在文档中找到特定文本并获取段落编号位置

这是针对 Excel VBA 的

Sub exportardatos()
'Paso 1: Declare las variables
Dim Paragraphe As Object, WordApp As Object, WordDoc As Object, WordTable As Object, WordRange As Object
File = "C:\Users\lper\Documents\FormExp.docx"

 On Error Resume Next

    'creationsession Word
    Set WordApp = GetObject(class:="Word.Application")

    'Clear the error between errors
    Err.Clear
    If WordApp Is Nothing Then Set WordApp = CreateObject(class:="Word.Application")

      If Err.Number = 429 Then
        MsgBox "Microsoft Word could not be found, aborting."
        GoTo EndRoutine
      End If

  On Error GoTo 0
    WordApp.Visible = True …
Run Code Online (Sandbox Code Playgroud)

excel vba ms-word

1
推荐指数
1
解决办法
3623
查看次数

标签 统计

excel ×1

ms-word ×1

vba ×1