![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I need help and or advice on a locating/developing a VB script for the following: 1) Marking up all words/phrases/sentences that have a particular format (italics, bold, etc.) with say user-defined delimiters such as “<” and “>” 2) Applying formatting (italics, bold, etc.) or user-created styles to all words/phrases/sentences that are delimited with user-defined delimiters such as “<” and “>” I have browsed the excellent sites of both Gregory K. Maxey and Graham Mayor, but I was unable to apply those macros for the above purposes. Thank you. |
#2
|
||||
|
||||
![]()
See, for example: https://www.msofficeforums.com/126958-post8.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thank you, Macropod.
I am a newcomer to VBA, but the code seems to make sense. |
#4
|
|||
|
|||
![]()
Hello Macropod,
The first routine works perfectly except when the paragraph mark itself is bold/italics. So, I’d first need to clean up all para marks. Also, if the space beyond the italicized element (word/phrase/sentence) is bold/italics, the space is included in the tag. The second routine works like a charm and correctly formats the document based on the tags. Thank you. That helps reduce a lot of the mundane Find/Replace/Insert work. I wonder if the first routine can be easily modified to ignore formatted paragraph marks and formatted space that comes after the relevant formatted text. Also, in both routines, it would be great if we could use a user-defined style for selection of text to be tagged and subsequently the tagged material to be formatted. Even if the routines cannot be extended (easily), thank you indeed. Ravi |
#5
|
||||
|
||||
![]() Quote:
.Text = "" to: .Text = "[!^13]{1,}" See the notes in the linked post.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Thank you, Macropod.
I see this in the note: As coded, that macro will also insert the </i>, etc. after any formatted paragraph mark. To exclude the paragraph marks, change: .Text = "" to: .Text = "[!^13]{1,}" Thank you for giving me a great starting point. I’ll try to study VBA and extend the code a little. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to apply Normal dot styles | John9210 | Word VBA | 2 | 06-07-2018 05:15 PM |
URGENT: Macro to open document and apply other macros successively | Krategy | Word VBA | 1 | 12-02-2016 04:41 PM |
VBA Word - Find & Apply Styles to Specific Words - Using Case Statement | jc491 | Word VBA | 17 | 12-26-2015 12:25 PM |
Apply styles in word table | 1van | Word VBA | 2 | 11-17-2015 11:05 AM |
![]() |
Liz T | Word | 4 | 07-22-2015 09:10 PM |