[VBA, paste text to all subtopics'notes01] I am writing a macro for this fx, suggestions wellcomed.
Discussion Open
hi,
i knew some programming from high school/college,
let's see if i could make a macro as the title suggest.
usage:
i got a tree of topics, i wanna select the top one and then paste text to all subtopics' notes. (add to, not append).
From previous reading,
when i select a topic, i could easily get a collection of subtopics by the "allsubtopics" property.
but i duno how to access it, then i found this:
recently found a doc from ms on how to access a list's items.
from previous post, i already knew how to write text into a topic's note.
so i think combine both will make it.
let's see
here shows how to loop thru the collection:
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/for-eachnext-statement
here shows how to loop thru the collection:
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/for-eachnext-statement
hey, for pasting text to multi SELECTED topics, the VBA is almost here:
currently you select multiple topics, then it insert "5" into the note.will be easy to switch that "5" into the content from clipboard.
HOWEVER,
i think choosing a topic and automatically populate into all subtopics is better than "multiple selected", although sometimes you may use 1, sometimes you may use the other.
let's see.
hey, for pasting text to multi SELECTED topics, the VBA is almost here:
currently you select multiple topics, then it insert "5" into the note.will be easy to switch that "5" into the content from clipboard.
HOWEVER,
i think choosing a topic and automatically populate into all subtopics is better than "multiple selected", although sometimes you may use 1, sometimes you may use the other.
let's see.
i just tried, this script works for me, this is what i want.
there are just come combinations:
note is "add to" vs "append"
"all sub topics" vs "multiple selected"
currently, if you use F4 to hide other brances, then you can still use ctrl-A to select all, and paste.
in this way it functions same as "all sub topics"
i just tried, this script works for me, this is what i want.
there are just come combinations:
note is "add to" vs "append"
"all sub topics" vs "multiple selected"
currently, if you use F4 to hide other brances, then you can still use ctrl-A to select all, and paste.
in this way it functions same as "all sub topics"
just wanna point out,
what the script do is "insert text at note start", not append, yet.
just wanna point out,
what the script do is "insert text at note start", not append, yet.
oh, i removed the unused codes,
used the InputBox as suggested by Nick
and for each Insert cycle, the code will add a new line at first.
turns out only 6 lines of code for doing things, the other 3 is for declaration.
oh, i removed the unused codes,
used the InputBox as suggested by Nick
and for each Insert cycle, the code will add a new line at first.
turns out only 6 lines of code for doing things, the other 3 is for declaration.
---