![]() |
|
#1
|
|||
|
|||
|
Hello everybody,
i have an issue with Macros in Word , i tried a lot but i could not solve the problem . i need Word macro for selecting text and putting it in footnotes. i have two file ,there are not linked _Document.docx _footnote file.txt i send a real sample in this link on my google drive for download folder drive has a real sample need Word macro for selecting text and putting it in footnotes thanks |
|
#2
|
|||
|
|||
|
It's not hard to select text via VBA. It's also not difficult to place selected text into a footnote. You won't even have to copy and paste!
One of the questions you might have to ask is how much text do you want to select? A paragraph? A sentence? Be aware that Word considers "Hello Dr. Honey, how are you?" as two sentences because of the period after "Dr": "Hello Dr." and "Honey, how are you?" This script may not do exactly what you want, but hopefully it will give you ideas. The script selects a sentence and inserts it as a footnote. Code:
Dim x As String
With Selection
.Collapse ' Start by collapsing current selection
.Extend ' Select the entire sentence
.Extend
.Extend
End With
Let x = Selection
Selection.Footnotes.Add Range:=Selection.Range, Text:=x
|
|
#3
|
|||
|
|||
|
thanks for trying to help
unfortunately I am still stuck in this case. i need vba make this steps VBA search for digits loop 1 2 3 ... in _Document.docx then search for same start digits _footnote file.txt and selected paragraph text then past into a footnote. send a real sample in this link on my google drive for download folder drive ,, for understanding the question |
|
#4
|
|||
|
|||
|
If the footnotes are in a different file than the main document, and that second file is not a Word file, VBA might not be the right tool to automate the task.
A third-party scripting tool, like Macro Express or AutoHotkey, might be a better bet. However, unless you have hundreds (or thousands) of footnotes, it might be faster to insert the task manually than to automate the task via macros! |
|
| Tags |
| macro vba, word 2003 .docx |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word macro for selecting text and putting it in footnotes
|
mdhg | Word VBA | 20 | 03-06-2024 08:07 AM |
| Request for a macro to move footnotes (not formatted as footnotes) from end of page to end of doc | Pluckedchicken | Word VBA | 0 | 09-03-2020 05:21 AM |
| Modify macro to move only Blue font footnotes into the Text | John 4 | Word VBA | 11 | 09-01-2020 03:49 PM |
need help creating a Word macro selecting all and changing font, size, and color thanks
|
marna | Word VBA | 4 | 12-18-2018 07:20 PM |
| Selecting certain text in word | nancy | Word VBA | 4 | 04-06-2016 04:33 PM |