॥ श्री गणेशाय नमः ॥ श्री गुरुभ्यो नमः ॥ ॥ श्री परमात्माने नमः ॥
Date: 06-Aug-2026
---
Note: The VBA Macro may be updated in future if bugs are found. Please check for latest version. Incase you find any issues, please report it to indiaspirituality [at] gmail.com.
---
Namaste,
I have made an attempt to do proofreading for Sanskrit words using Monier Williams dictionary.
Sadly it is not possible to have proper spell check in Sanskrit as in case of English as MS Word does not provide either dictionary or proofreading tools. Sanskrit being a complex language and each line has compound words (longer words joined together using sandhi rules to form one big word).
This is a stop gap solution, something is better than nothing. Hindi Spell check may be helpful but adding another dictionary may make word heavy giving rise to lagging issues.
Monier-Williams dictionary contains stem words which are called as Headwords and their meaning which is helpful especially to those who are writing articles or books in English and use Sanskrit Devanāgarī and IAST. In general these are standalone words and not compound words. So spell check will become easy.
I have managed to create a custom Monier-Williams (MW) Sanskrit Dictionary which has Devanāgarī, IAST and ISO-15919 headwords with meaning.
In addition, CSV files are also created. They are used in a different tool - Sanskrit Spell Check Tool about which I will post it soon. CSV files are not useful for spell check in MS word. In additional to the headwords, they also contain their meaning. A separate file for nasal and anusvāra variants is also created. This file lists the extra words added which are not present in MW dictionary. They are valid words.
The original MW dictionary has some words with nasal variant but not anusvāra variants and vice versa. I have added these variants too. This increased total Headword count to 228,306 words.
For example चन्द्र and चंद्र, अहङ्कार and अहंकार. Their IAST and ISO-15919 variants are also added.
चन्द्र candra exits in MW but not चंद्र caṃdra (anusvāra variant added)
अहंकार ahaṃkāra exits in MW but not अहङ्कार ahaṅkāra (nasal variant added).
Those who wish to understand what are nasal variants can visit the published Google Docs -
Sanskrit Varnamala – A guide for Devanagari to IAST Converter v1-0-0Direct Link:
https://docs.google.com/document/d/e/2PACX-1vRMD2xZt2ElMttur9B42gH225diNFkg1J60Jz2CW8KVRS60tuxAjKYIycf1YP4CuivS-l-7G7e0YM8x/pubDetails of files
---
All three files are line-aligned. Total entries (identical in all three):
228,370
[Devanāgarī]
Base Headwords (MW): 194,078
Nasal Variants Added: 34,292 (4,340 anusvāra→nasal + 29,952 nasal→anusvāra)
Total Entries: 228,370
Approx. File Size: 4.26 MB
[IAST]
Base Headwords (MW): 194,078
Nasal Variants Added: 34,292 (4,340 anusvāra→nasal + 29,952 nasal→anusvāra)
Total Entries: 228,370
Approx. File Size: 4.90 MB
[ISO 15919]
Base Headwords (MW): 194,078
Nasal Variants Added: 34,292 (4,340 anusvāra→nasal + 29,952 nasal→anusvāra)
Total Entries: 228,370
Approx. File Size: 4.93 MB
[CSV files]
MW_Sanskrit_Dictionary_Comb_v13.csv ~25 MB (228,370 rows, 5 columns)
MW_Sanskrit_Nasal_Variants.csv 4.56 MB (34,328 rows, 8 columns)
---
There are two ways to check, first inside word as spell checker - IAST / ISO only. Word does not pick up Devanāgarī dictionary file.
1) .DIC files for spell check in MS Word
Open folder Word Dic files for MW sanskrit dictionary. Download IAST or ISO files but not both. The reason for selecting only one is that MS word for each key stroke checks millions of words as you type. IAST and ISO has many common spelling except letters like ṃ (IAST) and ṁ (ISO), etc 8-10 letters. While IAST is strictly for sanskrit, ISO is common for all Brahmi derived scripts like Hindi, Gujarati, Tamil, Telugu, etc. So they have mapped a few characters that are different than IAST so as to not assign same English letter to more than one Indian Script letter. Hence, it is a waste of memory and may make the word hand or become very slow. Our custom dictionary headword list is itself very long.
It will not check devanagari, so do not download it. Kept for archival purposes until I find a way to make word search devanāgarī script. One way is to download Hindi spell check from windows / MS word itself. But the confusion is whether it will still check the custom dictionary created by us or not as both Hindi and Sanskrit have similar words.
In Windows 11, add IAST or ISO ḌIC file to MS word either IAST or ISO but not both. Word lags and becomes slow if we add both due to large headword database. If this happens you will have to remove the custom dictionaries.
.dic files are nothing but text files with one word per line. To check the content, simply drag the file to any open browser like Chrome and it will open.
Adding Custom Dictionaries to MS Word
---
Step 1: Move your .dic file to the Custom Office Dictionary folder
While you can technically link a dictionary from any folder, placing it in Microsoft's default directory ensures it won't be accidentally deleted or disconnected.
Press Win + R on your keyboard to open the Run dialog box.
Copy and paste the following path, then press Enter: %appdata%\Microsoft\UProof
A File Explorer window will open. Copy and paste your custom .dic file into this folder.
Step 2: Link the dictionary in MS Word
Now, you need to tell Word to use this file for spell checking.
Open Microsoft Word 365.
Click on File in the top-left corner, then select Options at the bottom of the sidebar. (If you have no open document, it in bottom left below Accounts).
In the Word Options window, select Proofing from the left-hand menu.
Click on the Custom Dictionaries... button located under the "When correcting spelling in Microsoft Office programs" section.
Click the Add... button on the right side of the pop-up window.
Word should automatically open to the UProof folder where you just pasted your file. Select your .dic file and click Open.
Ensure the checkbox next to your newly added dictionary is checked.
Click OK on all open dialog boxes to save your changes.
MS Word Options button in Bottom Left
Options Menu --> click Proofing, then click Custom Dictionaries
Click Add Button
Browse the folder for file MW_sanskrit_IAST_extd.dic and select it and click Open.
Select the checkbox so that it shows blue tick mark and click OK button.
If you wish to have normal spell check, select the first two options -
[ ] Check spelling as you type
[ ] Mark grammar errors as you type
Note: If the word feels too slow and heavy, uncheck them if they are checked by default.
Use on-demand checking - Check Spelling and Grammar option from within MS word Ribbon
Under Review Tab, Inside Proofing section (usually the first section), select Button - Spelling and Grammar. Under drop down, select appropriate option. If you wish to just check spelling, select first option, else, by default second option is selected.
Let the spell check run
An Editor side panel will open. Word will highlight the errors with red curvy line. Optionally, you can click on the Spelling button and it will take you to next spelling.
Ignore the red curvy lines on Sanskrit devanāgarī.
When work is done, click cross button [ x ] on top right. This keeps MS word light for your work.
I hope this little effort will be helpful.
The other files
There are other files in the download folder - CSV Files and Python Codes
They are not needed for end user. They are there, just in case you lose the files, they can be easily regenerated in about 1 minute using Python and Google Colab. No prior knowledge of coding is required.
You can read the README file - README_MW_Sanskrit_Dictionaries_extd_v13.txt
The .py files (python files) -
1. Monier_Williams_Dictionary_Generator_v13_colab.py is the file you can use to extract MW dictionary. You can use Google Colab and run the code. IT will download five files. Refer README file for further details.
Other python file -
2. English_Wordlist_Generator_v2_colab.py --> this is the file used to extract English wordlist based on Hunspell.
Both are not copy righted and free to use for personal purpose. Credits to respective owners.
Other files in the folder are connected with MW Spell check HTML tool (Sanskrit MW Spell-Check, Meaning & Sandhi* v6.3.2 beta) which will be released soon. There are other files in the main folder which are also related to MW spell check HTML Tool. Ignore them for now. The tool, is working, documentation is pending. Instructions are given in README file. You are free to try it. I use it daily. I ma not getting time to create a post and publish it. The MW Sanskrit Spell Check Tool will always be in beta state as the sandhi splitter is very limited and experimental, just as an aid for help, not reliable.
2) VBA macro for converting IAST to Devanāgarī and vice versa
Since we have the word check for Sanskrit but only in IAST, we can type the word in IAST and then use a macro to convert the IAST into devanāgarī. For example, the word rāma when selected and macro us run, will add the word राम after the IAST with a space between them i.e. rāma राम. Alternatively if you type the word राम, select it and run the macro, it will add the IAST word before the devanāgarī with space between them i.e. rāma राम. In either case, IAST will be first followed by Devanāgarī.
Note: If you wish to change the order, simply upload this macro which is .BAS file to Claude AI chatbox and ask it to change the order - I want to change the output so that the devanāgarī is always the first word followed by IAST and claude AI will do the job.
A VBA Macro can be run using a shortcut key or add it in the ribbon. For MS word, it needs to be saved as a module inside normal.dotm file visible after you open Visual Basic Editor (ALT + F11).
How to add VBA macro to MS word withtout saving the file as .dotm
1. Download the .BAS file from Google Drive folder. Current file name as on 05-08-2026 is -
VBA_Macro_IAST_Devanagari_Converter_v1_1_1 (2).bas
Simply import it. Unlike import in Excel creates annoying another blank file when we import .bas file in Excel's Personal file (equivalent to word's Normal file), this won't create such problem.
2. Open Visual Basic Code Editor -->
ALT + F11
You can also open it via Developer Tab --> Visual Basic button.
If Developer tab is not available. Right click on any empty part of ribbon.
Now enable the
Developer Tab
Now, go to
Developer Tab and click
Visual Basic button. It will open Visual basic editor.
2a. Simple way:
On the left side there is Project Window, scroll upwards until you see the file named Normal (~xxxx). Inside the nested table, there is an expanded menu titled Modules. Click on '+' sign. Right click on Modules text. You may or may not see the list. If module section is not available. On the Normal file itself, right click it.
A menu will appear. Now, click Import File.
Locate the file you just downloaded. It is generally in Downloads folder (Windows 11 default folder).
Select the file and click Open.
It will get imported and a new Macro in the list will appear titled IAST_Dev_Duplicator. Same name will appear in Properties window in the name row.
It's done! The macro is active.
Note: If you are importing this module for the first time, you will not see the first line in your case -->
---
Attribute VB_Name = "IAST_Dev_Duplicator"
---
If you see, and it is in black or red colour, not green, then simply put a ( ' ) i.e. apostrophe symbol which is prior to Enter key. It also has double quotes ( " ) . It is a comment symbol.
This is responsible to give name to the module.
Remember, name of module must not be same as that of module or macro name. Else there will be clash. Also note that if you have any macro with same module name or same macro name, it will not work and will show an error. Module name and macro name has to be unique.
The macro name is ConvertIASTDevanagari.
It can be seen in the code after comments.
---
' -- Public entry point ---------------------------------------
Public Sub ConvertIASTDevanagari()
---
2b. Manually add the Module
Right click on the .bas file (usually in downloads folder)
File name: VBA_Macro_IAST_Devanagari_Converter_v1_1_1 (2).bas
Open it in Notepad or Notepad++ (better option). It directly opens bas files.
In Notepad, it will open with first line shown as
---
Attribute VB_Name = "IAST_Dev_Duplicator"
---
Just comment it and put a space.
---
' Attribute VB_Name = "IAST_Dev_Duplicator"
---
Copy it --> CTRL + A, CRTL + C
To add it manually,
Open the VB Editor, right click on the Modules, go to Insert, then click on Module.
In the blank window on right side, just paste the code.
You will have to name the Module yourself. For that. Simply go to properties and add the word
---
IAST_Dev_Duplicator
---
Refer to earlier screenshot #2 in earlier section 2a.
If properties windows below the Project Window is not available, go to View Tab --> Select Properties window in dropdown menu.
3. Run the VBA Macro in MS Word
In order for macro to work, first select the word you wish to convert. Either Devanāgarī or IAST Roman
Example 1: राम
Example 2: rāma
Example 3: योग
Example 4: yoga
Select राम or rāma. Now run the macro (explained in next session). No matter which ever you select, Devanāgarī or IAST Roman i.e. राम or rāma the macro will identify it and then duplicate the word. The order will always be IAST Devanāgarī i.e. राम will be duplicated to rāma and added before राम –> rāma राम.
Alternatively if you select rāma it will duplicate to राम and place it after rāma –> rāma राम
The output will be
rāma राम
योग yoga
Irrespective of the script selected.
Note you need to select the whole word and not just put the cursor on the word.
Now, to run the macro there are a few ways -
a. Macros list box (default way)
b. Keyboard Shortcut key (fastest for regular use)
c. Add it to the Ribbon (useful if you lose key binding)
3a. Macros List box (default way)
Press ALT + F8 opens Macros list box. Alternatively you can open it from Developer tab. It is just after Visual Basic Button titled Macros.
Search for macro name (not Module name). Module name won't appear. Module name is for out convenience. Default name is module 1, module 2, etc if you have copy pasted VBA macro from Notepad.
---
ConvertIASTDevanagari
---
Click Run button and it will give the output
---
rāma राम
---
3b. Add a Keyboard shortcut
This is the fastest way to run any macro.
Right click on empty area on Ribbon and click Customize the Ribbon Button
It will open the Customize Ribbon Tab in Options Menu. Look for Keyboard shortcuts: and click the button Customize...
In Left panel, Scroll down to the bottom until you see Macros. Click on it. On right side, search for our Macro named - ConvertIASTDevanagari
---
ConvertIASTDevanagari
---
Assign any keyboard shortcut. If this is your first macro, nothing to worry, just assign a shortcut key. If you have macros, make sure that you assign a free key and not pre-assigned key.
I have assigned CTRL + 9 (number 9 in numpad). Note that it will not work for the number #9 on main keyboard which is above other keys and shares opening bracket " ( ". However, any control key, left or right will work.
Press CTRL key and then 9 on the num pad.
(You can choose any other key too. Generally ATL keys are default word shorts. So you can assign ATL + CTRL + [any key of your choice] and see if it gets accepted by Word or not.)
It will appear in the shortcut key box titled Press new shortcut key: in the right side below the macro Listbox.
Click Assign button on Bottom Left.
This will make an Entry on the middle left list box which lists the key. If the macro is already bound, it will display the key here. The right side Press new shortcut key: field will be empty.
Also make sure that Save changes in Normal.dotm is selected. It is generally selected by default.
Click Close key.
Now select a word and press CTRL + 9 i.e. Press the Control Key, keep it pressed and press 9 from numpad. Release CTRL key and the word will be duplicated as explained in earlier section 3a.
Note: Any changes in the VBA code in the VBA editor even adding a comment will break the key binding. CTRL + 9 will no longer work and you will have to re-assign the keyboard short.
3c. Add macro to Ribbon (convenient).
This is the most convenient way to do it for those who like to use mouse instead of keyboard (due to keyboard phobia if something wrong happens then ...)
It also does not depend upon keyboard shortcut. Just incase the shortcut key is not working somehow, this will definitely work.
There are two way to add it. If you have many macros, you can create a separate TAB titled Macros. MS Word allows user to create another Tab which will be placed last after the Help Tab.
3c(i). Adding it to Home Tab under new Group
If you have up to six macros, you can directly add it to the Home Tab as I have done it.
Right click on empty area on Ribbon and click Customize the Ribbon button (on left side, you have empty area.)
In options menu, on right side
Expand it by clicking on the > button.
Clicking it the name Home will not expand the tab. (No need to press right click, just normal left click for right handed mouse).
Now click on Home to select it as shown in screenshot. (This is default Tab in MS word.)
Click Button New Group button in the bottom. A new Group will be created. Click Rename button (blue box) which is next to the New Group button.
Remove prefilled text (New Group) and type Custom Macros in the field and click OK.
The word Custom in brackets (Custom) after out newly created group Custom Macros will be added automatically.
Click on the newly created Custom Group i.e. Custom Macros (Custom) to select it.
On the left side, in the dropdown select Macros option. you will find it on top left below the title Choose commands from:
Now, search for -
---
Normal.IAST_Dev_Duplicator.ConvertIASTDevanagari
---
Click Add button as in earlier screenshot.
Macro will appear in the Custom Macros group.
Select the macro. Click on Rename Button
Delete the long default name and type - IAST_Dev_Dup
---
IAST_Dev_Dup
---
or any short name of your choice. The shorter the better.
In the same screen, you can choose any icon. I have chosen a flowchart which is not correct but I am running out of symbols as I have many macros.
You can select anyone like a play button or an arrow, etc. It is just visual indicator.
After selecting an icon of your choice, Click OK
Now, you have a shortcut of this Macro on your Home tab. It will be after Add-ins group titled Custom Macros
It's done!.
Just select the word in MS word like rāma or राम and click on this button IAST_Dev_Dup
Macro will run and add duplicate word in order earlier explained
---
rāma राम
---
Note: There are no capital letters in Devanāgarī. So as to convert properly, IAST words are made case-insensitive to make them convert properly, Else Rāma will not convert properly leaving capital 'R' as it is without conversion to Devanāgari.
3c(ii). Creating a New Tab and adding it under new Group
Those who are regularly creating and using macros are well-versed with word functionality and are capable enough to ask any AI or watch YouTube videos and do it themselves. This method will create another Tab just like other default tabs like Home Tab, Developer Tab, Help Tab, etc.
New Tab will be added after the selected tab. For example if you select i.e. click on Home Tab and then click New Tab Button, it will be created after Home Tab.
Creating new Custom Group, adding Custom Macro is the same process. I am not going give full tutorial step-by-step with all screenshots. Those interested can refer to earlier section 3c(i).
Go to Options --> Customize Ribbon --> New Tab
A New Tab with New Group will be created.
By right clicking on each of them, Rename New Tab as Marcos and new group as suitable. For example Format Macros, Spell Check Macros, Editing Macros, Other Custom Macros, etc.
This creates Tab and Group.
Arrange the position of Tab by using the buttons on right or by right clicking and selecting appropriate options Move Up or Move Down
Now follow the steps in earlier section to add the custom macro, rename it and choose icon of your choice.
I hope this tools and this tutorial are helpful.
|| Hari OM ||
No comments:
Post a Comment