I’m trying to work out if KM can work within Microsoft excel and word on my Apple iMac
I am frustrated that I cannot set up what I consider to be a simple macro within Microsoft Word
I have tried setting up a macro using Microsoft’s own macros to change the font within a document and have been unsuccessful
All I want to do is within a document to have any words that are in Cambria font to be identified and then change its colour to blue in the font size to 14
If I use the search and replace option within word I’m able to achieve this without a problem. However if I try to set up a macro, it does not work. All
This is what the macro looks like and is clearly incorrect and non-functional.
’ Macro1 Macro
ActiveWindow.DocumentMapPercentWidth = 19
ActiveWindow.DocumentMap = True
Can anyone please tell me if I can achieve this with KM
thank you very much
I don’t think you need KM for this task.
This simple Word VBA Macro works for me. Give it a test and let me know if it works for you.
One note: I found two fonts with the “Cambria” name in my Word 2011 setup:
- “Cambria (Theme Body)”
I had to take precautions to make sure my test text was using the first font.
###Word VBA Script
' Change ALL Text with "Cambria" font to:
' • Color: Blue
' • Size: 14
'--- SET FIND CRITERIA ---
.Text = ""
.Font.Name = "Cambria"
.Forward = True
.Wrap = wdFindContinue
.Format = True
'--- SET REPLACE CRITERIA ---
.Text = ""
.Font.Color = wdColorBlue
.Font.Size = 14
'--- CHANGE ALL TEXT IN DOCUMENT ---
Thank you so much for your help. I presume that I have to copy this into the macro file and run it ?
I will give it a go and let you know how I get on
Thank you so much.
It works well.
Do you know what the colour name is for a navy Blue
Yep. In fact, I used that in my macro.
But it is a slow and tedious process to setup the F&R every time.
The macro is helpful if you often need to repeat the same process.
VBA macros, just like KM macros, are for automating repetitive processes.
Nope. But you can experiment with other colors in the Word VBA Editor.
Start a new line, and type:
and you will see the popup list I highlighted in yellow providing you with color choices.
You can also do a Google search for "word vba font color", and you should get some info.
Thank you this resolved my question