Font color
Font color
When using a hotkey to type a text, for example an e-mail, is there a code to change the fontcolor?
Re: Font color
Depends entirely on whether you can control your e-mail client in any way (has nothing to do with AHK)
Re: Font color
What do you mean (sorry, im dutch). I make hotkeys for emails. My colleques open a e-mail in Outlook en type a shortcut for the type of hotkey they want to use. Then the autohotkey writes the e-mail. Question is if it's possible to change the font color of a word or sentence in that text.
-
- Posts: 188
- Joined: 17 Jan 2019, 10:13
Re: Font color
Als je het font van een email wilt aanpassen moet je zorgen dat je AHK script dezelfde acties uitvoert als de persoon dat zal doen.
Waarschijnlijk kan het ook met behulp van allemaal ingewikkelde functies en commands maar op dat level zit ik nog niet
Hoop dat het lukt!
Code: Select all
^1:: ; hotkey
send ^n ; open new mail
send {tab 3} ; go to mail textbox
send !o ; alt+o, open menu shortcut
send fc ; select textcolor
MouseClick on color ; je kan hier met ImageSearch je gewenste kleur zoeken en erop klikken
send % clipboard ; paste text
return
Hoop dat het lukt!
Re: Font color
Dank voor je reactie (lekker makkelijk in het nederlands ), maar hoe ga ik deze code toevoegen in de hotkey tekst? Deze begint bij mij met SendInput en daarna komt de tekst van de mail. Ik gebruik bijvoorbeeld wel {ctrl down}{ctrl up} voor sneltoetsen, maar wat moet ik dan precies gebruiken als ik van een deel van de tekst de tekstkleur zou willen wijzigen...?
-
- Posts: 188
- Joined: 17 Jan 2019, 10:13
Re: Font color
Wel he!
De code die ik stuurde kan je in Notepad++ plakken, of welke editor dan ook, en wanneer je deze runt, dmv ctrl+1 (en mail actief is, Outlook in dit geval) wordt het script geactiveerd.
Send % Clipboard plakt de tekst die je in je clipboard heb gezet dmv ctrl+c/x.
De kleur van specifieke delen van de tekst aanpassen is echter vrij ingewikkeld.
Dan zal je moeten kijken naar een combi van InStr en Substr of naar RegEx. Dit ligt er ook aan of je continu hetzelfde deel wilt aanpassen in de tekst of dat dit verschilt.
Als je standaard dezelfde zin wilt aanpassen kan je ook kijken naar ImageSearch om die zin te zoeken en deze te selecteren om vervolgens het font aan te passen.
Dus, wat is het precies dat je wilt?
De code die ik stuurde kan je in Notepad++ plakken, of welke editor dan ook, en wanneer je deze runt, dmv ctrl+1 (en mail actief is, Outlook in dit geval) wordt het script geactiveerd.
Send % Clipboard plakt de tekst die je in je clipboard heb gezet dmv ctrl+c/x.
De kleur van specifieke delen van de tekst aanpassen is echter vrij ingewikkeld.
Dan zal je moeten kijken naar een combi van InStr en Substr of naar RegEx. Dit ligt er ook aan of je continu hetzelfde deel wilt aanpassen in de tekst of dat dit verschilt.
Als je standaard dezelfde zin wilt aanpassen kan je ook kijken naar ImageSearch om die zin te zoeken en deze te selecteren om vervolgens het font aan te passen.
Dus, wat is het precies dat je wilt?
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Font color
Inderdaad handig, maar ik denk dat de rest van de leden en misschien de beheerders dit niet zo 'handig' vinden.
*Translation: Indeed handy you guys can talk Dutch amongst eachother, but I doubt the other members and admins think it convenient
*Translation: Indeed handy you guys can talk Dutch amongst eachother, but I doubt the other members and admins think it convenient
Re: Font color
'Thanks for your reply, but i'm afraid this is going to be too difficult for me.. I was hoping for an option simular to the one for making the font bold for example, like {ctrl down}b{ctrl up}. A code where i can put in fontcolor like 0/0/153 or #000099. But there is no shortcut in windows for changing fontcolor, so i think what i want is not possible...
Re: Font color
(Det är bra om konversationen sker på forumets språk - Engelska )
As i said in Swedish - the language of this forum is English.
However, the manual is available in German .: Deutsche Hilfedateien
Do not know if there is any AHK forum with German as a language.
(I hope you respect this message)
As i said in Swedish - the language of this forum is English.
However, the manual is available in German .: Deutsche Hilfedateien
Do not know if there is any AHK forum with German as a language.
(I hope you respect this message)
-
- Posts: 188
- Joined: 17 Jan 2019, 10:13
Re: Font color
Haha, you are probably right WotD
@MachteldV
Oke, I think I understand what you want a bit more clear rn.
While it isn't pretty, you could try something like this.
Again, this is in Outlook tho, you'll need to lookup the shortcuts for selecting color in other programs.
EDIT:
@Albireo, haha although it looks a bit the same, we are from The Netherlands, not Germany
@MachteldV
Oke, I think I understand what you want a bit more clear rn.
While it isn't pretty, you could try something like this.
Code: Select all
; make selected red
^1::
send !o
send fc
send {down 7}{left 4}{enter}
return
; make selected black
^2::
send !o
send fc
send {enter}
return
EDIT:
@Albireo, haha although it looks a bit the same, we are from The Netherlands, not Germany
Last edited by AviationGuy on 24 May 2019, 05:24, edited 1 time in total.
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Font color
You probably get better result using COM, but that's way to complicated for me personally, but there are some
very talented users in here who might be able to assist.
@albirio, we are Dutch (The Netherlands) no German
very talented users in here who might be able to assist.
@albirio, we are Dutch (The Netherlands) no German
Re: Font color
hmm.. that's way too complicated i'm afraid. And we have to make te hotkey today. I think we go to plan B or C. But thanks for all your input and help!
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Font color
Did you try AviationGuy's script ? It works for me.
Re: Font color
Try and change the heading to font color Outlook then I think you get more answers? (I do not use outlook)
Maybe this links will help you?
Automating an HTML Outlook email with AutoHotKey
Changing font type, color, size with 1 set of code across all MS Office programs
How do I create an autohotkey script to change font color in oneNote? (Does OneNote work on same way as Outlook?)
Keyboard Shortcut to Change Font Ink Color?
Have not tested any of the tips above.
I do not know if Outlook can handles control sequences in the text (something like ctrl+#0xff0000 + Some text ... )
or maybe HTML-code can work?
But this is a Outlook issue - Is it possible to change color on characters in Outlook? How? (the only way?)
When you have an answer to these questions, I believe that AHK can fulfill your desire.
(Maybe there is someone in the forum who reads your question, already has the solution - But the title of this thread would be clearer?)
Maybe this links will help you?
Automating an HTML Outlook email with AutoHotKey
Changing font type, color, size with 1 set of code across all MS Office programs
How do I create an autohotkey script to change font color in oneNote? (Does OneNote work on same way as Outlook?)
Keyboard Shortcut to Change Font Ink Color?
Have not tested any of the tips above.
I do not know if Outlook can handles control sequences in the text (something like ctrl+#0xff0000 + Some text ... )
or maybe HTML-code can work?
But this is a Outlook issue - Is it possible to change color on characters in Outlook? How? (the only way?)
When you have an answer to these questions, I believe that AHK can fulfill your desire.
(Maybe there is someone in the forum who reads your question, already has the solution - But the title of this thread would be clearer?)
-
- Posts: 440
- Joined: 28 Apr 2018, 21:59
Re: Font color
When creating an email you can indeed use basic html codes like the font color, but you would have to do something like this to get it to work the way your want.
This will create a new email and when it displays the information it should be in red text. You could create a custom editor and send it automatically through outlook, but I know this isn't exactly what you wanted. But if you can use autohotkey to change stuff in word it shouldn't have a problem doing it in outlook, especially since they use word as the basis of the formatting (since 2007).
Code: Select all
m := ComObjActive("Outlook.Application").CreateItem(0)
m.Subject := "Outlook Automation"
m.To := "[email protected];"
m.CC := ""
m.HTMLBody := "<font color="red">I am red text</font>"
m.Display
;m.Send
return
Who is online
Users browsing this forum: No registered users and 385 guests