Take the 2-minute tour ×

Hopefully this should be a simple one for anyone who understands COM. I have a VB script that uses the office spell checker to check what ever is added to the clipboard. This has been floating around for many years, but now that AutoHotkey supports COM objects I thought I would try converting it over to AHK. I don't know much about COM, but it's worked pretty well so far except for one line.

oWD.ActiveDocument.Close wdDoNotSaveChanges

I cannot figure out how to pass the


constant to


in AutoHotkey. If I use it as above from the VB script, I receive an "This line does not contain a recognized action" error. Sorry again about not using proper code tags, but I am visually impaired and the post editor is not completely accessible.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

wdDoNotSaveChanges is an Office constant. Sometimes you can get lucky by Googling for "wdDoNotSaveChanges value", or sometimes you have to go digging. In this case, the google answer worked so the value is 0, so you would convert your code to:


or the slightly more self-documented:


The latter is a good trick for all API constants but you have to know where to look for the values.

share|improve this answer
That works. Thanks for the assistance. –  Diamond Jan 27 '13 at 12:48
add comment

Your Answer


