Here the approach is described with pictures: https://sites.google.com/site/pinyotae/Home/visual-studio-visual-c/create-user-defined-environment-variables-macros
In Visual Studio you need to:
- Click in the main menu “View”, then “Property Manager”
- Right-click in the empty space of “Property Manager” window and in the pop-up menu click “Add New Project Property Sheet”
- After adding the property sheet, double click it in the Property Manager window and in the tree on the left select property page “User Macros”
- Then you can click “Add Macro” button
Here is a tutorial on Project Property Sheets: http://www.dorodnic.com/blog/2014/03/20/visual-studio-macros/