Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2023, 04:54 AM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Default macro for in-text comments in student assignments

I got as far as 'record macro,' name, and 'assign key' but from then on I get lost.

I want to insert a
character style,
in 'Universe Condensed Light',
Size 11,
in 'Automatic blue (not the darkest blue to make it easily stand out from black)

Hoping that you can sort me out,
with thanks,
Ulrike
Reply With Quote
  #2  
Old 08-20-2023, 09:14 AM
gmayor's Avatar
gmayor gmayor is offline macro for in-text comments in student assignments Windows 10 macro for in-text comments in student assignments Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Is there a good reason why you don't use Word's Insert Comment function?
You can modify the Comment Text style in the document to display in any font and colour you prefer, though I would suggest that you stick to standard fonts as Word will substitute a font from the available fonts if the one you have chosen is not available.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-20-2023, 09:35 AM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Default

Thank you for replying, gmayor.

I prefer in-text comments to be in the text as an interjection rather than a teaching comment.

At the moment, I create for each assignment 'Style1,' choosing 'Character' and for Formatting, 'Universe Condensed Light', size 11, and from 'Automatic' the not quite dark blue. But it means I need to change in the student's document to 'Style1' for every insertion I need to make.

A colleague has told me how to record a macro for this so I only need to press my chosen key for each insertion. It turns out that despite his care, over three days I did not manage to come up with a workable macro. I worked for years without a macro, but the idea of a macro appeals to me.

So, fingers crossed that someone can sort me out.
Ulrike
Reply With Quote
  #4  
Old 08-20-2023, 01:15 PM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Default PS my colleague's suggestion

My colleague thought I could deal with it because it was easy:

"no tweaking is required, one just needs to be very particular about the sequence of events - I think it was something like "type first char", then "shift and back-arrow" to highlight first char, then change font, then change colour, then "forward arrow" to unselect it, then type the remainder (not forgetting a space at the end)."

With my best attempt, I found there is no 'font' icon to click.

Ulrike
Reply With Quote
  #5  
Old 08-20-2023, 10:42 PM
gmayor's Avatar
gmayor gmayor is offline macro for in-text comments in student assignments Windows 10 macro for in-text comments in student assignments Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following will enter your comment text at the cursor, formatted as required.
Code:
Sub MyComment()
Dim oRng As Range
Dim sComment As String
    sComment = InputBox("Type Comment", "Inline Comment")
    If sComment = "" Then Exit Sub
    Set oRng = Selection.Range
    With oRng
        .Collapse 0
        .Text = sComment
        .Font.Color = RGB(0, 153, 255)
        .Font.Name = "Universe Condensed Light"
        .Font.Size = 11
        .Collapse 0
        .Select
    End With
    Set oRng = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #6  
Old 08-21-2023, 04:57 AM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Default Brilliant!

Thank you so much, gmayor! It actually works, having survived my part of the action. I would never have been able to do it - my colleague was too optimistic.

May I be greedy and ask you to change
'.Font.Color = RGB(0, 153, 255)'
to a darker blue and without bold? I tried but am no good even for that small change.

I'd like my interjections to look less reproachful.

And, would you allow me to post your message, including your reference to your website, in our Commons Room Forum? Other tutors work with the Style1 option, preferring interjections and writing teaching comments in a separate feedback file.

With lots of thanks,
Ulrike

Last edited by Ulrike; 08-21-2023 at 05:06 AM. Reason: preference
Reply With Quote
  #7  
Old 08-21-2023, 08:05 AM
gmayor's Avatar
gmayor gmayor is offline macro for in-text comments in student assignments Windows 10 macro for in-text comments in student assignments Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The font used is not bold, but to ensure that remains true


Code:
    With oRng
        .Collapse 0
        .Text = sComment & Chr(32)
        .Font.Color = RGB(51, 51, 204)
        .Font.Name = "Universe Condensed Light"
        .Font.Size = 11
        .Font.Bold = False
        .Collapse 0
        .Select
    End With
This uses a darker blue.

By all means pass on the message to your colleagues.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #8  
Old 08-22-2023, 01:50 AM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Smile Thank you for the perfect in-text comments macro!

Thank you, Graham,

It's just perfect now.

My colleagues will be well pleased to have a no longer work-intensive option for their in-text comments even without being technologically gifted.

Thank you again,
Ulrike
Reply With Quote
  #9  
Old 11-06-2023, 09:16 AM
Ulrike Ulrike is offline macro for in-text comments in student assignments Windows 7 64bit macro for in-text comments in student assignments Office 2016
Novice
macro for in-text comments in student assignments
 
Join Date: Aug 2023
Posts: 9
Ulrike is on a distinguished road
Default Apologies, I messed up

Graham, I am so sorry, I messed up my perfectly working macro.

When it did not come up by pressing the assigned key, I could still get it in 'Viewing macros.'

I thought I had to reassign it. So, I started with your perfectly working instructions. But when I try to run it, I get 'Compile error: Invalid outside procedure'

I tried to understand the instructions in the Help link. My techie ambitions were not enough to understand how to proceed.

With my heartfelt apologies,
Ulrike
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting the amount of comments 'done' and 'not done' with a macro caspy Word VBA 2 10-23-2022 12:27 AM
Acronym Macro - Ms Word comments Davereynolds1946 Word VBA 0 12-11-2021 04:45 AM
macro for in-text comments in student assignments Macro to maintain formatting OR to delete all text (excluding comments) jimmy12 Word VBA 6 05-15-2021 02:48 AM
Macro to highlight and bolden specific text in Word Comments PCUSER Word VBA 1 09-22-2020 03:08 PM
How to insert comments thro' macro AlexandarR Word VBA 4 06-05-2015 10:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft