Macro to change font in Microsoft Office Applications

Hello - I am new to KM but I have browsed through these forums and other knowledge bases for KM and have not been able to find an answer.
How can I create a macro that will quickly allow me to set font type and color before I start typing in an MS Office application such as Outlook and Word? To be clear, the method of selecting text, copying to Clipboard and then format and paste it is not suitable for my workflow. I have tried simulating keystrokes (open the font menu, type the font name etc. but then I get stuck at changing font color since Outlook doesn't have a way for keystroke based navigation in the UI to change font color).
I am rather surprised that there are not more canned macros for common tasks like this (based on the number of posts that seem to be asking this question).

I don't have MS Office, but I do have Apple Pages. You can assign a hotkey to a paragraph style directly in Pages. You don't need KM to do that. I googled it and seem to have found web pages that say you can also do this in Microsoft Word. Are you aware of this? If so, is that not what you want to do?

It's not clear to me whether you want to set the style for an individual sequence of characters or an entire paragraph. I believe these are different mechanisms in MS Word. One is called character formatting and the other is called paragraph formatting. The solution would be different depending on which one you want.

I just want to change the font (type and color) quickly using a hot key and then start typing (Outlook or Word etc). So, I guess individual sequence of characters?

Thanks

Have you tried pasting in already font/colour formatted text and then selecting it, ready for you to over-type?

For some reason, Outlook seems to add a Return to the pasted text, so you need to go back twice:

Font:colour test.kmmacros (4.9 KB)

You could probably do this in Word with AppleScript, but since you need to use this method in Outlook (MS have ripped out a lot of useful functionality, both scripting and otherwise, in recent versions) you might as well have one macro for both.

Genius idea! Well, except that it doesn't work for me using Pages. The paragraph style overrides whatever you have in the styled text in your KM action.

Wow! That's a pretty good workaround. That actually worked! Thank you so much.

No, it was a kludge to get round MS-induced problems.

There's been posts before about macroing/scripting Page's Format pane, but I'm afraid I'm old-school -- dump in plain text then go back and format -- so didn't pay much attention.

Not sure this is relevant, but remember you can edit Word's default template (normal.dotm) so that all new documents start with your preferred fonts, styles, etc.

And Outlook has a setting for default font.

K

Right, I was afraid that that particular idea would be prone to complications. And I have no idea if Word supports AppleScript, but even if it did, I couldn't help with that.

FYI It does - as do Excel, PowerPoint, Outlook and Edge

The problem I have is that such formatting changes work on "ranges" -- fine when you're changing text that's already there, but I've never worked out how to "from this point on use this font at this size".

I've got the same issue with Pages and the easiest workaround I can see is to image detect the "Character styles" pop-up and type a character -- note that it only accepts a single character and matches that against the first character of all style names so you'll need first character uniqueness.

Me too, I even spent the last 10 minutes googling how to "from this point on use this font at this size" and couldn't find an answer. According to the tutorial videos I found, the character styles feature is for changing existing selected text, not "from this point on use this font style." However I think your genius idea of pushing some styled text into Word could potentially be a solution. It's a bit messy because now you have to duplicate the styles in KM rather than just use the ones in MS Word.

In Word, the proper solution is to create custom character styles and assign shortcut keys to them. It's only when you want to do the same in Outlook, which doesn't support styles, that you need to resort to this -- and since you need to create your own styles in KM for Outlook you might as well use those everywhere.

Whether you should be going mad with styles in email is another question, but I realise my views on that are rather old-fashioned :wink:

I needed this solution for something that I do often in Outlook and Word - respond to an email or provide comments to text in a Word document inline. But I want my response to be in font and color that is different from the original text. This macro now gives me the ability to do exactly that.

Thanks

If you're all using Word, don't mess around. Turn on "Track Changes" for the document and have at it -- Word will do all this stuff for you. If people send you an email, paste the contents into Word and send your commented version back as an attachment.

If you start doing it, people will usually join in. And when the majority are doing it life becomes much easier -- the cross-document consistency alone is worth any initial hiccups.