Proofreading software for ms word code#
The Userform and code are shown following this discussion. The Userform provides the user interface to display the pre-defined comment text and offer the user the opportunity to edit the comment text. The first thing it does is declare a Userform object. It is the workhorse of this project or the procedure that actually does something in the document. 'This is the dropdown control onAction callback. Sub GetItemSuperTip(ByVal control As IRibbonControl, Index As Integer, ByRef supertip) Sub GetItemScreenTip(ByVal control As IRibbonControl, Index As Integer, ByRef screentip) Again, since it is called once for each item in the dropdown, we simply set the screentip text to the corresponding item in the array. 'This callback provides the screentip for each item in the dropdown. Sub GetSelectedItemIndex(ByVal control As IRibbonControl, ByRef Index) 'This callback sets the displayed item in the dropdown control. Sub GetItemLabel(ByVal control As IRibbonControl, Index As Integer, ByRef label)
![proofreading software for ms word proofreading software for ms word](https://www.scribbr.com/wp-content/themes/scribbr-2017/img/word-guide/example-showing-comments-insertions-deletions-word-2007.gif)
Since it is called once for each item in the dropdown, we simply set the label to the corresponding item in the array containing the label data.
![proofreading software for ms word proofreading software for ms word](https://i.ytimg.com/vi/lHlfk3LWdc4/hqdefault.jpg)
'This callback provides the label for each item in the dropdown. Sub GetItemCount(ByVal control As IRibbonControl, ByRef count) 'number of labels contained in the label array. 'This callback provides the number of items in the dropdown. TempArray(i - 1) = Left(oTbl.Cell(i, 3).Range.Text, Len(oTbl.Cell(i, 3).Range.Text) - 2) 'Loop through the column 3 rows putting the content of each cell in the array. TempArray(i - 1) = Left(oTbl.Cell(i, 2).Range.Text, Len(oTbl.Cell(i, 2).Range.Text) - 2)įunction GetScreenTipArray(ByVal oTbl As Table) As String() 'Loop through the column 2 rows putting the content of each cell in the array. TempArray(i - 1) = Left(oTbl.Cell(i, 1).Range.Text, Len(oTbl.Cell(i, 1).Range.Text) - 2)įunction GetCommentArray(ByVal oTbl As Table) As String() 'Loop through the column 1 rows putting the content of each cell in the array. Set oDoc = Documents.Add(aTemplate.FullName,, , False)įunction GetLabelArray(ByVal oTbl As Table) As String() If aTemplate.Name = "Proofreading Marks AddIn.dotm" Then 'Change this line if you use a different name for your template The data in the table is passed as a variable to the three functions which loads the arrays. When the AddIn loads a new temporary document containing the data store table is created. 'This procedure and the succeeding three functions loads the data from the data store into the arrays. 'This procedure creates a ribbon object for the project Private myArrayTri() As String 'This array holds the screentip text Private myArraySec() As String 'This array holds the pre-defined comment text
![proofreading software for ms word proofreading software for ms word](https://chevronediting.com.au/wp-content/uploads/2020/08/proofread-ms-word-3.jpg)
Private myArrayPri() As String 'This array holds the label text I named mine "Proofreader." Copy the following code in the new module: Open the VB Editor and create a standard project module in the template project.This is expected because the callbacks in the XML shown above are looking for data in the VBA project that doesn't exist yet. Note: You will see several Word errors when the template opens. Save the template changes, close the template and exit the Custom UI Editor.