How does VBA read the directory information automatically generated by a WORD document?

Updated on technology 2024-03-18
6 answers
  1. Anonymous users2024-02-06

    You can get the directory, so for each paragraph object, you can access it. Collection, for the first hyperlink object, you can execute its follow method, so that you can jump to the corresponding section, and then read the content of the document on this basis. I don't know what you mean by "corresponding content", but I guess you'll have to do some iteration and judgment.

  2. Anonymous users2024-02-05

    Hello I want to ask.,The directory you got through that interface.,Thank you.,I haven't found it for a long time.。

  3. Anonymous users2024-02-04

    How can it be so complicated, just copy and paste the ** in word directly into excel.

  4. Anonymous users2024-02-03

    Yes, it would be better if the format in your word was also uniform, and you can look at your document specifically.

  5. Anonymous users2024-02-02

    Important: VBA opens the Word file and matches it with Find or a regular expression.

  6. Anonymous users2024-02-01

    sub test()

    dim f, n, x, wb, fname

    on error resume next

    Open the file (you can select more than one).

    f = "word file, *docm,", 1, "Select the file", multiselect:=true)

    Iterate through each selected file.

    for x = 1 to ubound(f)

    sfile = f(x)

    Take the file name and assign a value to the cell.

    n = len(sfile) -instrrev(sfile, "\")

    fname = right(sfile, n)

    cells(x, 1) = left(fname, instr(fname, " ") -1) 'Take the character before the space from 1.

    cells(x, 1) = left(fname, 9) 'Take the first 9 characters of the file name.

    cells(x, 2) = mid(fname, instr(fname, " ") +1, len(fname) -instr(fname, ".") +1) 'Take the characters after the space and before the point.

    cells(x, 2) = mid(fname, 10, len(fname) -instr(fname, ".") +1) 'Fetch the characters before the dot starting from 10.

    next x

    end sub

Related questions
14 answers2024-03-18

oleobject object.

See the Properties Method Event Property. >>>More

16 answers2024-03-18

It's the formulater font that's wrong.

Open the document and double-click on the mathematical formula that has the display problem, and the formulator will start automatically. Click "Style - Definition" in the interface of the formulator, and click "Advanced" in the "Define Style" dialog box that pops up >>>More

7 answers2024-03-18

First of all, open the Word document with macros and click on the file button in the upper left corner as shown in the image below: >>>More

9 answers2024-03-18

I took a look at LZ's questions and follow-up questions. There are two possibilities, one is that it is not in the archive location. The icon store is not displayed near the bottom right corner, which is very small. >>>More

15 answers2024-03-18

Hello friends! It may be that there is something wrong with your next method. >>>More