How to check font type of Clipboard?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Posts: 203
Joined: 06 Aug 2017, 08:21
Location: Germany

How to check font type of Clipboard?

22 Jun 2018, 06:26

Hi guys,

I know how it is possible to let AHK find out whether the Clipboard contains text or not.

Code: [Select all] [Download] GeSHi © Codebox Plus

if not (DllCall("IsClipboardFormatAvailable", "Uint", 1) OR DllCall("IsClipboardFormatAvailable", "Uint", 13)) ; if there is no text:
MsgBox, No text was copied!
ExitApp ; Close script

However, I would like to know if/how it's possible to find out the format of the text.
Would be interesting if AHK could check if it's underlined, italic or bold.
(Font color is not that important, yet interesting to know if that would be possible as well.)

I tried different types of this:

Code: [Select all] [Download] GeSHi © Codebox Plus

if Clipboard contains bbold
MsgBox, text is bold

(Also tried ^bbold^, ^bold)

It would be very helpful because I copy a lot of text from Excel.
Depending on its font format, I could use different functions.

I'm not an expert, just an enthusiastic AutoHotkey user.
If my post contains the word Gaming, it does not automatically mean it's a gaming related question ;)
Keyboard: Logitech G15 first generation - Mice: Logitech G9, G502, G602 - OS: Windows 7 Pro 64 Bit AHK version:
Posts: 7
Joined: 20 Apr 2014, 06:55

Re: How to check font type of Clipboard?

22 Jun 2018, 07:09

1 and 13 are plain text formats, which means no formating, only character codes. There is also 7, CF_OEMTEXT. They are apparently not the formats you need. You can use InsideClipboard to see what formats Excel puts on the clipboard when you copy from it.
Posts: 849
Joined: 11 Jan 2017, 17:59

Re: How to check font type of Clipboard?

22 Jun 2018, 10:18

tested with word 2016

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Return to “Ask For Help”

Who is online

Users browsing this forum: valuex and 57 guests