Script Collection
Lotus Notes
Automating MS Developer Studio | Automating MS Developer Studio |
|
|
|
|
This example comments out a selection in Microsoft Developer Studio.
import win32com.client # This script comments out the currently selected text block app = win32com.client.Dispatch('MSDev.Application') wnd = app.ActiveWindow if wnd.Type == 'Text': # Get current selection select = str(wnd.Selection) # comment out s = map(lambda x:'//'+x,select.split('\r\n')) # Replace current selection by new textbuffer wnd.Selection = '\r\n'.join(s) app = None |
|
| Last Updated ( Thursday, 02 February 2006 ) |
| < Prev | Next > |
|---|
Hint: For syntax highlighting and correct Python intendation place your code between html tags <pre> and </pre>.