#1
|
|||
|
|||
Creating macro in 2007 to bold within quotes on the fly
Hi - I am trying to create a macro so far unsuccessfully. I type reports for doctors and in the reports they quote the patient and he wants the statement of the patient bolded and then end quote not bolded. I want to be able to do this on the fly without having to type the whole report and then go back and search for all the statements he wanted bolded in quotes. So he will say for example, the patient says beginning quote bold I am having difficulty in this area unbold end quote. Is there any way I can do this so as soon as I hear him say quote bold, have a keyboard macro for it right then? I have tried all afternoon to figure one out. Just not my forte....thanks for any help. |
#2
|
|||
|
|||
I don't understand what you are looking for. There is already a built-in command to toggle bold on an off (Ctrl+b). So when the doctor says quote bold your type " and press CTRL+b and keep typing. When he says unbold quote you type Ctrl+b and "
What am I missing? |
#3
|
|||
|
|||
Hi: I know if have a toggle ctrl b for bold, I am looking for a macro that will put the beginning quotes, the bolded statement and the ending quotes as a keyboard command, all in one, because he does many many quoting and bolding in long sentences, one right after the other, that I have stop, take my fingers off the keyboard, use the Ctrl B and then Ctrl B to unbold and then to end quote. Thought there would be an easier way using a macro to do the above at once. Do you understand what I am trying to do?
|
#4
|
|||
|
|||
Mary,
No I don't understand. From what I can gather you are typing something that has been dictated. The doctor says "quote bold the patients knee bone is connected to the elbow bold unquote and then you type " ctrl b the patient's knee bone is connected to the elbow ctrl+b " How is any macro suppose to know what you are going to type after the first " ctrl + b? Obviously I don't understand what your process is and until I do I won't be able to help. |
#5
|
||||
|
||||
Quote:
A macro would require a different keyboard shortcut, or a button. How would that be an advantage? But if you insist, the macro recorder will do the job.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
If I assume that you are starting with existing text like:
This is quote bold test test test unbold end quote.This is quote bold test test test unbold end quote. The maybe something like this is what you are after" Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim oRng As Word.Range Set oRng = ActiveDocument.Range With oRng.Find .Text = "quote bold*unbold end quote" .MatchWildcards = True While .Execute oRng.Words.First.Delete oRng.Words.First.Delete oRng.Words.Last.Delete oRng.Words.Last.Delete oRng.Words.Last.Delete oRng.Bold = True oRng.InsertBefore """" oRng.InsertAfter """" oRng.Characters.Last.Bold = False oRng.Collapse wdCollapseEnd Wend End With lbl_Exit: Exit Sub End Sub |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to replace straight quotes with smart quotes in existing document | PABwriter | Word | 4 | 05-27-2016 03:36 PM |
macro to add brackets to each line and add single quotes to each word in the line | bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
macro to format selected text with curly quotes | ysostarman | Word VBA | 10 | 11-11-2014 12:51 PM |
Macro Needed to bold specific lines and Macro to turn into CSV | anewteacher | Word VBA | 1 | 05-28-2014 03:59 PM |
Changing single-quotes to double-quotes | Bobosmite | Word | 5 | 04-15-2013 06:40 AM |