Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / July 2006

Tip: Looking for answers? Try searching our database.

Get/Set word wrap mode in a macro?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank S - 10 Jul 2006 21:54 GMT
How can I determine if word wrap is on in a Visual Studio 2003 macro?
Can word wrap be changed with a macro?

Thanks,

Frank
Peter Macej - 11 Jul 2006 09:01 GMT
> How can I determine if word wrap is on in a Visual Studio 2003 macro?

For plain text editor use the following:
    Sub toggleWordWrap()
        Dim wrap As Boolean

        Dim props As EnvDTE.Properties
        props = DTE.Properties("TextEditor", "PlainText")
        Dim prop As EnvDTE.Property = props.Item("WordWrap")
        wrap = prop.Value
        prop.Value = Not wrap
    End Sub

For other language, change the second parameter of DTE.Properties to
desired language. For the list of language names see keys under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AutomationProperties\TextEditor.

Signature

Peter Macej
Helixoft - http://www.vbdocman.com
VBdocman - Automatic generator of technical documentation for VB, VB
.NET and ASP .NET code

Frank S - 11 Jul 2006 14:37 GMT
>> How can I determine if word wrap is on in a Visual Studio 2003 macro?
>
[quoted text clipped - 12 lines]
> desired language. For the list of language names see keys under
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AutomationProperties\TextEditor.

Peter,

Thanks for the help. That is exactly what I needed. (I had done some
searching, but did not find anything about this property.)

Frank
Carlos J. Quintero [VB MVP] - 11 Jul 2006 09:17 GMT
See the macros TurnOnWordWrap / TurnOffWordWrap supplied in the Samples
macro project, Utilities module.

Also, there is a command that you can execute to toggle the word wrap:

DTE.ExecuteCommand("Edit.ToggleWordWrap")

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

> How can I determine if word wrap is on in a Visual Studio 2003 macro? Can
> word wrap be changed with a macro?
>
> Thanks,
>
> Frank
"Gary Chang[MSFT]" - 11 Jul 2006 09:24 GMT
Hi Frank,

Thank you posting!

Besides Peter's solution, you can also use issue the following command in
your macro to toggle the wordwrap status directly:

DTE.ExecuteCommand("Edit.ToggleWordWrap")

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.