+ Reply to Thread
Results 1 to 9 of 9

Print VBA code in Editor format colors

  1. #1
    Sarah Jane
    Guest

    Print VBA code in Editor format colors

    I originally posted this question on 8/8/2005 in
    microsoft.public.office.developer.officedev.other, but since I still have not
    gotten any response, I decided to try again by posting it in this Discussion
    Group.

    In the Visual Basic Editor under Tools -> Options -> Editor format, I can
    specify the code colors for Normal Text, Comment Text, Keyword Text, etc.
    This is a wonderful feature when trying to edit a macro. However, when I
    print the code so that I can review it and pencil in edits that I want to
    make when I return to my computer, everything is black even though I sent it
    to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    COLORS? I tried selecting all, copying, and pasting into a Word document in
    hopes that it would retain the colors, but it doesn't. Any other ideas?

    Sarah Jane

  2. #2
    Tom Ogilvy
    Guest

    Re: Print VBA code in Editor format colors

    The vbe does not print in color.

    --
    Regards,
    Tom Ogilvy

    "Sarah Jane" <[email protected]> wrote in message
    news:[email protected]...
    > I originally posted this question on 8/8/2005 in
    > microsoft.public.office.developer.officedev.other, but since I still have

    not
    > gotten any response, I decided to try again by posting it in this

    Discussion
    > Group.
    >
    > In the Visual Basic Editor under Tools -> Options -> Editor format, I can
    > specify the code colors for Normal Text, Comment Text, Keyword Text, etc.
    > This is a wonderful feature when trying to edit a macro. However, when I
    > print the code so that I can review it and pencil in edits that I want to
    > make when I return to my computer, everything is black even though I sent

    it
    > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > COLORS? I tried selecting all, copying, and pasting into a Word document

    in
    > hopes that it would retain the colors, but it doesn't. Any other ideas?
    >
    > Sarah Jane




  3. #3
    Sarah Jane
    Guest

    Re: Print VBA code in Editor format colors

    Thanks. I think I'll go post a Suggestion for Microsoft. :^)

    Sarah Jane

    "Tom Ogilvy" wrote:

    > The vbe does not print in color.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Sarah Jane" <[email protected]> wrote in message
    > news:[email protected]...
    > > I originally posted this question on 8/8/2005 in
    > > microsoft.public.office.developer.officedev.other, but since I still have

    > not
    > > gotten any response, I decided to try again by posting it in this

    > Discussion
    > > Group.
    > >
    > > In the Visual Basic Editor under Tools -> Options -> Editor format, I can
    > > specify the code colors for Normal Text, Comment Text, Keyword Text, etc.
    > > This is a wonderful feature when trying to edit a macro. However, when I
    > > print the code so that I can review it and pencil in edits that I want to
    > > make when I return to my computer, everything is black even though I sent

    > it
    > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > COLORS? I tried selecting all, copying, and pasting into a Word document

    > in
    > > hopes that it would retain the colors, but it doesn't. Any other ideas?
    > >
    > > Sarah Jane

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Print VBA code in Editor format colors

    Just some added:

    http://support.microsoft.com/default...b;en-us;213191
    XL2000: Modules Cannot Be Printed in Color

    http://support.microsoft.com/default...b;en-us;173083
    Modules Cannot Be Printed in Color

    --
    Regards,
    Tom Ogilvy

    "Sarah Jane" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    >
    > Sarah Jane
    >
    > "Tom Ogilvy" wrote:
    >
    > > The vbe does not print in color.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Sarah Jane" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I originally posted this question on 8/8/2005 in
    > > > microsoft.public.office.developer.officedev.other, but since I still

    have
    > > not
    > > > gotten any response, I decided to try again by posting it in this

    > > Discussion
    > > > Group.
    > > >
    > > > In the Visual Basic Editor under Tools -> Options -> Editor format, I

    can
    > > > specify the code colors for Normal Text, Comment Text, Keyword Text,

    etc.
    > > > This is a wonderful feature when trying to edit a macro. However,

    when I
    > > > print the code so that I can review it and pencil in edits that I want

    to
    > > > make when I return to my computer, everything is black even though I

    sent
    > > it
    > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > > COLORS? I tried selecting all, copying, and pasting into a Word

    document
    > > in
    > > > hopes that it would retain the colors, but it doesn't. Any other

    ideas?
    > > >
    > > > Sarah Jane

    > >
    > >
    > >




  5. #5
    DGolds
    Guest

    Re: Print VBA code in Editor format colors

    Hi Sarah,
    I developed a macro in Word that will color all of your comments green and
    put a line under each sub or function (in code that you have pasted into Word
    from the vbe of any MS office program). I was originally going to go all out
    and have it color the keywords blue as well, but I ran out of motivation-it
    seemed to me that having the comments green and separating the procedures
    acheived my goal of making it more readable. Anyway, let me know if you're
    interested and I'll post the code.
    -Dave

    "Tom Ogilvy" wrote:

    > Just some added:
    >
    > http://support.microsoft.com/default...b;en-us;213191
    > XL2000: Modules Cannot Be Printed in Color
    >
    > http://support.microsoft.com/default...b;en-us;173083
    > Modules Cannot Be Printed in Color
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Sarah Jane" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    > >
    > > Sarah Jane
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > The vbe does not print in color.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "Sarah Jane" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I originally posted this question on 8/8/2005 in
    > > > > microsoft.public.office.developer.officedev.other, but since I still

    > have
    > > > not
    > > > > gotten any response, I decided to try again by posting it in this
    > > > Discussion
    > > > > Group.
    > > > >
    > > > > In the Visual Basic Editor under Tools -> Options -> Editor format, I

    > can
    > > > > specify the code colors for Normal Text, Comment Text, Keyword Text,

    > etc.
    > > > > This is a wonderful feature when trying to edit a macro. However,

    > when I
    > > > > print the code so that I can review it and pencil in edits that I want

    > to
    > > > > make when I return to my computer, everything is black even though I

    > sent
    > > > it
    > > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > > > COLORS? I tried selecting all, copying, and pasting into a Word

    > document
    > > > in
    > > > > hopes that it would retain the colors, but it doesn't. Any other

    > ideas?
    > > > >
    > > > > Sarah Jane
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Sarah Jane
    Guest

    Re: Print VBA code in Editor format colors

    Hi Dave,
    That would be wonderful! I was just thinking about going to go write a
    macro myself. I would greatly appreciate your allowing me to use yours
    instead.
    Many thanks,
    Sarah Jane

    "DGolds" wrote:

    > Hi Sarah,
    > I developed a macro in Word that will color all of your comments green and
    > put a line under each sub or function (in code that you have pasted into Word
    > from the vbe of any MS office program). I was originally going to go all out
    > and have it color the keywords blue as well, but I ran out of motivation-it
    > seemed to me that having the comments green and separating the procedures
    > acheived my goal of making it more readable. Anyway, let me know if you're
    > interested and I'll post the code.
    > -Dave
    >
    > "Tom Ogilvy" wrote:
    >
    > > Just some added:
    > >
    > > http://support.microsoft.com/default...b;en-us;213191
    > > XL2000: Modules Cannot Be Printed in Color
    > >
    > > http://support.microsoft.com/default...b;en-us;173083
    > > Modules Cannot Be Printed in Color
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Sarah Jane" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    > > >
    > > > Sarah Jane
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > The vbe does not print in color.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > > "Sarah Jane" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I originally posted this question on 8/8/2005 in
    > > > > > microsoft.public.office.developer.officedev.other, but since I still

    > > have
    > > > > not
    > > > > > gotten any response, I decided to try again by posting it in this
    > > > > Discussion
    > > > > > Group.
    > > > > >
    > > > > > In the Visual Basic Editor under Tools -> Options -> Editor format, I

    > > can
    > > > > > specify the code colors for Normal Text, Comment Text, Keyword Text,

    > > etc.
    > > > > > This is a wonderful feature when trying to edit a macro. However,

    > > when I
    > > > > > print the code so that I can review it and pencil in edits that I want

    > > to
    > > > > > make when I return to my computer, everything is black even though I

    > > sent
    > > > > it
    > > > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > > > > COLORS? I tried selecting all, copying, and pasting into a Word

    > > document
    > > > > in
    > > > > > hopes that it would retain the colors, but it doesn't. Any other

    > > ideas?
    > > > > >
    > > > > > Sarah Jane
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >


  7. #7
    DGolds
    Guest

    Re: Print VBA code in Editor format colors

    Here it is:

    Sub MakeCommentsGreen()
    On Error GoTo Handler
    Dim lngResponse As Long, strMsg As String
    Dim i As Long
    Dim blnEndProc As Boolean
    lngResponse = MsgBox("Running this procedure on text other than Visual
    Basic " & _
    "code may have unintended consequences. Continue?", vbYesNo)
    If lngResponse = vbYes Then
    With Selection
    ' Beginning of document
    .HomeKey Unit:=wdStory
    For i = 1 To
    ActiveDocument.BuiltInDocumentProperties(wdPropertyLines)
    '1st character in line
    .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    'Find the 1st non-blank character in the line
    Do Until .Characters(1) <> " "
    .MoveRight Unit:=wdCharacter, Count:=1
    Loop
    'Select the line
    .EndKey Unit:=wdLine, Extend:=wdExtend
    'Check for end of procedure
    Select Case Left(.Text, Len(.Text) - 1)
    Case "End Sub", "End Function"
    blnEndProc = True
    Case Else
    blnEndProc = False
    End Select
    If Not blnEndProc Then
    'Change font color of comments to green
    If .Characters(1) = "'" Then
    .Font.Color = wdColorGreen
    .Collapse
    ElseIf InStrRev(.Text, "'") > InStrRev(.Text, Chr(34))
    Then
    Do Until .Characters(1) = "'"
    .Collapse
    .MoveRight Unit:=wdCharacter, Count:=1
    Loop
    .EndKey Unit:=wdLine, Extend:=wdExtend
    .Font.Color = wdColorGreen
    End If
    Else
    'Add bottom border after end sub and end function
    statements
    With .Borders(wdBorderBottom)
    .LineStyle = Options.DefaultBorderLineStyle
    .LineWidth = Options.DefaultBorderLineWidth
    .Color = Options.DefaultBorderColor
    End With
    End If
    'Next line
    .MoveDown Unit:=wdLine, Count:=1
    .HomeKey Unit:=wdLine
    Next i
    End With
    End If
    ExitHere:
    Exit Sub
    Handler:
    MsgBox "Unexpected error #" & Err.Number & ": " & Err.Description
    Resume ExitHere
    End Sub

    I have this in a module in "Normal" in MS Word so I can run it on any doc.
    Hope it helps.
    -Dave

    "Sarah Jane" wrote:

    > Hi Dave,
    > That would be wonderful! I was just thinking about going to go write a
    > macro myself. I would greatly appreciate your allowing me to use yours
    > instead.
    > Many thanks,
    > Sarah Jane
    >
    > "DGolds" wrote:
    >
    > > Hi Sarah,
    > > I developed a macro in Word that will color all of your comments green and
    > > put a line under each sub or function (in code that you have pasted into Word
    > > from the vbe of any MS office program). I was originally going to go all out
    > > and have it color the keywords blue as well, but I ran out of motivation-it
    > > seemed to me that having the comments green and separating the procedures
    > > acheived my goal of making it more readable. Anyway, let me know if you're
    > > interested and I'll post the code.
    > > -Dave
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Just some added:
    > > >
    > > > http://support.microsoft.com/default...b;en-us;213191
    > > > XL2000: Modules Cannot Be Printed in Color
    > > >
    > > > http://support.microsoft.com/default...b;en-us;173083
    > > > Modules Cannot Be Printed in Color
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "Sarah Jane" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    > > > >
    > > > > Sarah Jane
    > > > >
    > > > > "Tom Ogilvy" wrote:
    > > > >
    > > > > > The vbe does not print in color.
    > > > > >
    > > > > > --
    > > > > > Regards,
    > > > > > Tom Ogilvy
    > > > > >
    > > > > > "Sarah Jane" <[email protected]> wrote in message
    > > > > > news:[email protected]...
    > > > > > > I originally posted this question on 8/8/2005 in
    > > > > > > microsoft.public.office.developer.officedev.other, but since I still
    > > > have
    > > > > > not
    > > > > > > gotten any response, I decided to try again by posting it in this
    > > > > > Discussion
    > > > > > > Group.
    > > > > > >
    > > > > > > In the Visual Basic Editor under Tools -> Options -> Editor format, I
    > > > can
    > > > > > > specify the code colors for Normal Text, Comment Text, Keyword Text,
    > > > etc.
    > > > > > > This is a wonderful feature when trying to edit a macro. However,
    > > > when I
    > > > > > > print the code so that I can review it and pencil in edits that I want
    > > > to
    > > > > > > make when I return to my computer, everything is black even though I
    > > > sent
    > > > > > it
    > > > > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > > > > > COLORS? I tried selecting all, copying, and pasting into a Word
    > > > document
    > > > > > in
    > > > > > > hopes that it would retain the colors, but it doesn't. Any other
    > > > ideas?
    > > > > > >
    > > > > > > Sarah Jane
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >


  8. #8
    Sarah Jane
    Guest

    Re: Print VBA code in Editor format colors

    Dave,
    I tried it, and it is totally awesome! The only thing your macro didn't
    catch, because it no longer had the apostrophe (') in front of it, was the
    end of a comment that MS Word wrapped when I pasted the code. The remedy for
    this is a simple matter of making sure the length of my comment lines is
    shorter. Thanks so much for your help.
    Sarah Jane


    "DGolds" wrote:

    > Here it is:
    >
    > Sub MakeCommentsGreen()
    > On Error GoTo Handler
    > Dim lngResponse As Long, strMsg As String
    > Dim i As Long
    > Dim blnEndProc As Boolean
    > lngResponse = MsgBox("Running this procedure on text other than Visual
    > Basic " & _
    > "code may have unintended consequences. Continue?", vbYesNo)
    > If lngResponse = vbYes Then
    > With Selection
    > ' Beginning of document
    > .HomeKey Unit:=wdStory
    > For i = 1 To
    > ActiveDocument.BuiltInDocumentProperties(wdPropertyLines)
    > '1st character in line
    > .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    > 'Find the 1st non-blank character in the line
    > Do Until .Characters(1) <> " "
    > .MoveRight Unit:=wdCharacter, Count:=1
    > Loop
    > 'Select the line
    > .EndKey Unit:=wdLine, Extend:=wdExtend
    > 'Check for end of procedure
    > Select Case Left(.Text, Len(.Text) - 1)
    > Case "End Sub", "End Function"
    > blnEndProc = True
    > Case Else
    > blnEndProc = False
    > End Select
    > If Not blnEndProc Then
    > 'Change font color of comments to green
    > If .Characters(1) = "'" Then
    > .Font.Color = wdColorGreen
    > .Collapse
    > ElseIf InStrRev(.Text, "'") > InStrRev(.Text, Chr(34))
    > Then
    > Do Until .Characters(1) = "'"
    > .Collapse
    > .MoveRight Unit:=wdCharacter, Count:=1
    > Loop
    > .EndKey Unit:=wdLine, Extend:=wdExtend
    > .Font.Color = wdColorGreen
    > End If
    > Else
    > 'Add bottom border after end sub and end function
    > statements
    > With .Borders(wdBorderBottom)
    > .LineStyle = Options.DefaultBorderLineStyle
    > .LineWidth = Options.DefaultBorderLineWidth
    > .Color = Options.DefaultBorderColor
    > End With
    > End If
    > 'Next line
    > .MoveDown Unit:=wdLine, Count:=1
    > .HomeKey Unit:=wdLine
    > Next i
    > End With
    > End If
    > ExitHere:
    > Exit Sub
    > Handler:
    > MsgBox "Unexpected error #" & Err.Number & ": " & Err.Description
    > Resume ExitHere
    > End Sub
    >
    > I have this in a module in "Normal" in MS Word so I can run it on any doc.
    > Hope it helps.
    > -Dave
    >
    > "Sarah Jane" wrote:
    >
    > > Hi Dave,
    > > That would be wonderful! I was just thinking about going to go write a
    > > macro myself. I would greatly appreciate your allowing me to use yours
    > > instead.
    > > Many thanks,
    > > Sarah Jane
    > >
    > > "DGolds" wrote:
    > >
    > > > Hi Sarah,
    > > > I developed a macro in Word that will color all of your comments green and
    > > > put a line under each sub or function (in code that you have pasted into Word
    > > > from the vbe of any MS office program). I was originally going to go all out
    > > > and have it color the keywords blue as well, but I ran out of motivation-it
    > > > seemed to me that having the comments green and separating the procedures
    > > > acheived my goal of making it more readable. Anyway, let me know if you're
    > > > interested and I'll post the code.
    > > > -Dave
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > Just some added:
    > > > >
    > > > > http://support.microsoft.com/default...b;en-us;213191
    > > > > XL2000: Modules Cannot Be Printed in Color
    > > > >
    > > > > http://support.microsoft.com/default...b;en-us;173083
    > > > > Modules Cannot Be Printed in Color
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > > "Sarah Jane" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    > > > > >
    > > > > > Sarah Jane
    > > > > >
    > > > > > "Tom Ogilvy" wrote:
    > > > > >
    > > > > > > The vbe does not print in color.
    > > > > > >
    > > > > > > --
    > > > > > > Regards,
    > > > > > > Tom Ogilvy
    > > > > > >
    > > > > > > "Sarah Jane" <[email protected]> wrote in message
    > > > > > > news:[email protected]...
    > > > > > > > I originally posted this question on 8/8/2005 in
    > > > > > > > microsoft.public.office.developer.officedev.other, but since I still
    > > > > have
    > > > > > > not
    > > > > > > > gotten any response, I decided to try again by posting it in this
    > > > > > > Discussion
    > > > > > > > Group.
    > > > > > > >
    > > > > > > > In the Visual Basic Editor under Tools -> Options -> Editor format, I
    > > > > can
    > > > > > > > specify the code colors for Normal Text, Comment Text, Keyword Text,
    > > > > etc.
    > > > > > > > This is a wonderful feature when trying to edit a macro. However,
    > > > > when I
    > > > > > > > print the code so that I can review it and pencil in edits that I want
    > > > > to
    > > > > > > > make when I return to my computer, everything is black even though I
    > > > > sent
    > > > > > > it
    > > > > > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE SPECIFIED
    > > > > > > > COLORS? I tried selecting all, copying, and pasting into a Word
    > > > > document
    > > > > > > in
    > > > > > > > hopes that it would retain the colors, but it doesn't. Any other
    > > > > ideas?
    > > > > > > >
    > > > > > > > Sarah Jane
    > > > > > >
    > > > > > >
    > > > > > >
    > > > >
    > > > >
    > > > >


  9. #9
    Tom Ogilvy
    Guest

    Re: Print VBA code in Editor format colors

    Pretty-Print:
    http://www.submain.com/?nav=products.pcp

    has a free evaluation copy.

    --
    Regards,
    Tom Ogilvy

    "Sarah Jane" <[email protected]> wrote in message
    news:[email protected]...
    > Dave,
    > I tried it, and it is totally awesome! The only thing your macro didn't
    > catch, because it no longer had the apostrophe (') in front of it, was the
    > end of a comment that MS Word wrapped when I pasted the code. The remedy

    for
    > this is a simple matter of making sure the length of my comment lines is
    > shorter. Thanks so much for your help.
    > Sarah Jane
    >
    >
    > "DGolds" wrote:
    >
    > > Here it is:
    > >
    > > Sub MakeCommentsGreen()
    > > On Error GoTo Handler
    > > Dim lngResponse As Long, strMsg As String
    > > Dim i As Long
    > > Dim blnEndProc As Boolean
    > > lngResponse = MsgBox("Running this procedure on text other than

    Visual
    > > Basic " & _
    > > "code may have unintended consequences. Continue?", vbYesNo)
    > > If lngResponse = vbYes Then
    > > With Selection
    > > ' Beginning of document
    > > .HomeKey Unit:=wdStory
    > > For i = 1 To
    > > ActiveDocument.BuiltInDocumentProperties(wdPropertyLines)
    > > '1st character in line
    > > .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    > > 'Find the 1st non-blank character in the line
    > > Do Until .Characters(1) <> " "
    > > .MoveRight Unit:=wdCharacter, Count:=1
    > > Loop
    > > 'Select the line
    > > .EndKey Unit:=wdLine, Extend:=wdExtend
    > > 'Check for end of procedure
    > > Select Case Left(.Text, Len(.Text) - 1)
    > > Case "End Sub", "End Function"
    > > blnEndProc = True
    > > Case Else
    > > blnEndProc = False
    > > End Select
    > > If Not blnEndProc Then
    > > 'Change font color of comments to green
    > > If .Characters(1) = "'" Then
    > > .Font.Color = wdColorGreen
    > > .Collapse
    > > ElseIf InStrRev(.Text, "'") > InStrRev(.Text,

    Chr(34))
    > > Then
    > > Do Until .Characters(1) = "'"
    > > .Collapse
    > > .MoveRight Unit:=wdCharacter, Count:=1
    > > Loop
    > > .EndKey Unit:=wdLine, Extend:=wdExtend
    > > .Font.Color = wdColorGreen
    > > End If
    > > Else
    > > 'Add bottom border after end sub and end function
    > > statements
    > > With .Borders(wdBorderBottom)
    > > .LineStyle = Options.DefaultBorderLineStyle
    > > .LineWidth = Options.DefaultBorderLineWidth
    > > .Color = Options.DefaultBorderColor
    > > End With
    > > End If
    > > 'Next line
    > > .MoveDown Unit:=wdLine, Count:=1
    > > .HomeKey Unit:=wdLine
    > > Next i
    > > End With
    > > End If
    > > ExitHere:
    > > Exit Sub
    > > Handler:
    > > MsgBox "Unexpected error #" & Err.Number & ": " & Err.Description
    > > Resume ExitHere
    > > End Sub
    > >
    > > I have this in a module in "Normal" in MS Word so I can run it on any

    doc.
    > > Hope it helps.
    > > -Dave
    > >
    > > "Sarah Jane" wrote:
    > >
    > > > Hi Dave,
    > > > That would be wonderful! I was just thinking about going to go write

    a
    > > > macro myself. I would greatly appreciate your allowing me to use

    yours
    > > > instead.
    > > > Many thanks,
    > > > Sarah Jane
    > > >
    > > > "DGolds" wrote:
    > > >
    > > > > Hi Sarah,
    > > > > I developed a macro in Word that will color all of your comments

    green and
    > > > > put a line under each sub or function (in code that you have pasted

    into Word
    > > > > from the vbe of any MS office program). I was originally going to

    go all out
    > > > > and have it color the keywords blue as well, but I ran out of

    motivation-it
    > > > > seemed to me that having the comments green and separating the

    procedures
    > > > > acheived my goal of making it more readable. Anyway, let me know if

    you're
    > > > > interested and I'll post the code.
    > > > > -Dave
    > > > >
    > > > > "Tom Ogilvy" wrote:
    > > > >
    > > > > > Just some added:
    > > > > >
    > > > > > http://support.microsoft.com/default...b;en-us;213191
    > > > > > XL2000: Modules Cannot Be Printed in Color
    > > > > >
    > > > > > http://support.microsoft.com/default...b;en-us;173083
    > > > > > Modules Cannot Be Printed in Color
    > > > > >
    > > > > > --
    > > > > > Regards,
    > > > > > Tom Ogilvy
    > > > > >
    > > > > > "Sarah Jane" <[email protected]> wrote in

    message
    > > > > > news:[email protected]...
    > > > > > > Thanks. I think I'll go post a Suggestion for Microsoft. :^)
    > > > > > >
    > > > > > > Sarah Jane
    > > > > > >
    > > > > > > "Tom Ogilvy" wrote:
    > > > > > >
    > > > > > > > The vbe does not print in color.
    > > > > > > >
    > > > > > > > --
    > > > > > > > Regards,
    > > > > > > > Tom Ogilvy
    > > > > > > >
    > > > > > > > "Sarah Jane" <[email protected]> wrote in

    message
    > > > > > > > news:[email protected]...
    > > > > > > > > I originally posted this question on 8/8/2005 in
    > > > > > > > > microsoft.public.office.developer.officedev.other, but since

    I still
    > > > > > have
    > > > > > > > not
    > > > > > > > > gotten any response, I decided to try again by posting it in

    this
    > > > > > > > Discussion
    > > > > > > > > Group.
    > > > > > > > >
    > > > > > > > > In the Visual Basic Editor under Tools -> Options -> Editor

    format, I
    > > > > > can
    > > > > > > > > specify the code colors for Normal Text, Comment Text, Keywo

    rd Text,
    > > > > > etc.
    > > > > > > > > This is a wonderful feature when trying to edit a macro.

    However,
    > > > > > when I
    > > > > > > > > print the code so that I can review it and pencil in edits

    that I want
    > > > > > to
    > > > > > > > > make when I return to my computer, everything is black even

    though I
    > > > > > sent
    > > > > > > > it
    > > > > > > > > to a color printer. IS THERE A WAY TO PRINT THE CODE IN THE

    SPECIFIED
    > > > > > > > > COLORS? I tried selecting all, copying, and pasting into a

    Word
    > > > > > document
    > > > > > > > in
    > > > > > > > > hopes that it would retain the colors, but it doesn't. Any

    other
    > > > > > ideas?
    > > > > > > > >
    > > > > > > > > Sarah Jane
    > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > >
    > > > > >
    > > > > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1