Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2019, 01:26 PM
inlanoche inlanoche is offline Styling Comments with VBA Windows 10 Styling Comments with VBA Office 2016
Novice
Styling Comments with VBA
 
Join Date: Apr 2019
Posts: 14
inlanoche is on a distinguished road
Default Styling Comments with VBA

Our company wants to streamline how comments are made a tracked. For the most part I can deal with the tracking part, but I am having some issues with the 'making' of comments in the manner they want.



In the tracking part that I have done, I can stamp the current commenter's role it a protected area, and reference that as they make comments. Problem is when I create a comment via VBA, if I don't add text to the comment, then it opens the old annotations window at the bottom. If I sub in some text (such as "add Comment>") then word creates the comment in the new comment side pane, but sets the cursor back to the document. This is not desired as when the end user goes to type, it will write in the doc, not the comment area.

My next thought was to select the comment. This caused worse problems, though I might not be doing it the right way...
ActiveDocument.Comments(1).Range.Select

This lead to the comments side pane disappearing, and the revisions pane taking over, as well as the Show Comments button becoming greyed out.

The end result we are aiming for is that when the new custom Comments button is clicked, a new comment is made (the same as with the regular comment button), the Commenter's role is stamped (I got this working), the font color in the comment is set, and the focus (cursor) stays with the newly created comment (or pre-populated text is selected so when they type it is over written). Really, the last part is the most important.

I have played around with setting the comment to RichText and setting a start/end tag, which also looks nice, but though I record a macro, running the macro does not seem to take (seeming due to the fact that it works of a selection, and no selection is made).
Reply With Quote
  #2  
Old 04-11-2019, 07:19 AM
inlanoche inlanoche is offline Styling Comments with VBA Windows 10 Styling Comments with VBA Office 2016
Novice
Styling Comments with VBA
 
Join Date: Apr 2019
Posts: 14
inlanoche is on a distinguished road
Default .Edit

Ok, face palm on the new guy.

the 2 things I needed were
...comments(n).Edit
...comments(n).Select

This allows me to then do all the formatting I need (font color, Tag, LockContentControl).

so looks like This can be considered solved.
Reply With Quote
Reply

Tags
comment, style, text selection

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC styling struggles dangermoose Word 8 02-06-2019 03:00 PM
Styling Comments with VBA Styling equations kiltro Word 1 08-30-2018 03:57 PM
Styling contents in brackets attahK Word 3 06-10-2017 01:37 PM
Plain Text Content Control - Losing Styling on Carriage Return kintap Word 0 07-16-2014 12:43 PM
Styling 'code' in word scottyearl Word 0 03-08-2009 09:18 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 01:26 PM.


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