Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Devstudio Copyright Macro

0.00/5 (No votes)
31 Jan 2001 1  
A simple macro for adding a copyright notice to the start of your files.
  • Download source files - 4 Kb
  • Introduction

    Visual Studio allows us to perform common,repetitive tasks through macros. You, as a developer, will often find the need to insert copyright notices to your source code.This is a simple macro that does just that at the click of a button. Make your code safe from copyright infringements and look professional, in seconds. Welcome to the wonderful world of macros to beginners. If you are already comfortable with macros, skip to the relevant parts.

    Copyright notices

    What are Copyright notices? Copyright notices are comments that are added to source code by the author, before public distribution of that source. These are typically present at the top of the source files. These comments make users of those source files aware about the copyright issues involved. Additionally you can insert any information that you find relevant.

    This, for example, is a copyright notice that I often use.

    ////////////////////////////////////////////////////////////////////////////
    
    // Copyright : Amit Dey 2000
    
    // 
    
    // Email :amitdey@mail.com 
    
    // 
    
    // This code may be used in compiled form in any way you desire. This
    
    // file may be redistributed unmodified by any means PROVIDING it is
    
    // not sold for profit without the authors written consent, and
    
    // providing that this notice and the authors name is included.
    
    //
    
    // This file is provided 'as is' with no expressed or implied warranty.
    
    // The author accepts no liability if it causes any damage to your computer.
    
    //
    
    // Expect Bugs.
    
    // Please let me know of any bugs/mods/improvements.
    
    // and I will try to fix/incorporate them into this file.
    
    // Enjoy!
    
    ////////////////////////////////////////////////////////////////////////////
    
    

    You will need to customise this notice to suit your needs.

    How to install and use.

    This macro is also distributed as a devstudio macro file (.dsm) and is customizable and easy to use. To install the macro follow these simple steps

    1. Download the attached .dsm file and copy it to your Devstudio Macros directory. (For me, this is located under MSDev98 directory)
    2. Open MSDEV and goto Tools->Customize and click on AddIns and Macro files Tab.
    3. Enable the Copyright macro by enabling the checkbox next to it.
    4. Click on the Commands tab and select Macros from the Category list box.
    5. Drag-n-drop Copyright macro to the Devstudio toolbar.
    6. Select appropriate text/image(or both) from the Button Appearence dialog box and click on Close

    Now you have the macro ready for use.

    To insert your own copyright notices,(as you have guessed) you'd need to modify few parts of the macro file. To do this, go to Tools->Macro and click on Copyright macro and hit Edit. Edit the macro file to alter the Copyright notices to suit your need. Save the file.

    That's it. (Phew!)

    To use the macro simply place the cursor in a file where you would like to insert the copyright notice and click on the copyright macro button and say Presto!

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here