Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Comment block of code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick Charnes - 20 Jun 2007 14:58 GMT
Is there a way to comment an entire multi-line block of VBA code?  If I
have 10 lines I want to comment, it's frustrating to have to insert an
apostrophe in front of each one.  Thanks.
Bear - 20 Jun 2007 15:47 GMT
Rick:

In the VBE, display the Edit toolbar.

On the Edit toolbar you'll find the Comment Block button which does exactly
what you want. (There's also an Uncommend Block for later.)

Bear
Signature

Windows XP, Word 2000

Shauna Kelly - 20 Jun 2007 15:47 GMT
Hi Rick

Select all the lines of text you want to comment and click the "Comment
Block" button on the Edit menu.

For what it's worth, I always customize the Edit Menu so as to display the
text as well as the icons, and then change the captions to &Comment Block
and &Uncomment Block. Then, I can select the relevant lines and do Alt-c and
Alt-u.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Is there a way to comment an entire multi-line block of VBA code?  If I
> have 10 lines I want to comment, it's frustrating to have to insert an
> apostrophe in front of each one.  Thanks.
Rick Charnes - 20 Jun 2007 16:04 GMT
Thanks; do you mean the Edit TOOLBAR?  I didn't have the Edit toolbar
displayed and now that I've turned it on I now see the Comment Block
button.  But I don't see this option on the edit MENU as you indicate
here.  Thanks.

> Hi Rick
>
[quoted text clipped - 14 lines]
> > have 10 lines I want to comment, it's frustrating to have to insert an
> > apostrophe in front of each one.  Thanks.
Shauna Kelly - 21 Jun 2007 10:48 GMT
Yes: Edit toolbar.

Shauna

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Thanks; do you mean the Edit TOOLBAR?  I didn't have the Edit toolbar
> displayed and now that I've turned it on I now see the Comment Block
[quoted text clipped - 21 lines]
>> > have 10 lines I want to comment, it's frustrating to have to insert an
>> > apostrophe in front of each one.  Thanks.

Rate this thread:






 
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.