Skip to content

Instantly share code, notes, and snippets.

@razorgoto
razorgoto / comments2Table.vbs
Last active August 29, 2015 14:19
export word review comments
'By:
'Doug Robbins - Word MVP
'dkr@mvps.org
'dougrobbinsmvp@gmail.com
'http://answers.microsoft.com/en-us/office/forum/office_2007-customize/export-word-review-comments-in-excel/54818c46-b7d2-416c-a4e3-3131ab68809c?page=4&rtAction=1429151921582
'
'Creates a new document containing a table that displays the Page Number, the number of the Section in the document, the line number, the text upon which the comment is made, the text of the comment and the name of the person who made the comment.
'If the text upon which the comment was made, the table will include the contents of the cell that contain that text. If the text is not in a table, it will display the text of the first paragraph to which the comment applies
Dim source As Document, target As Document
@razorgoto
razorgoto / comments2xlsx.vb
Created April 16, 2015 03:17
Exports comments from a MS Word document to Excel and associates them with the heading paragraphs
Sub exportComments()
' Exports comments from a MS Word document to Excel and associates them with the heading paragraphs
' they are included in. Useful for outline numbered section, i.e. 3.2.1.5....
' Thanks to Graham Mayor, http://answers.microsoft.com/en-us/office/forum/office_2007-customize/export-word-review-comments-in-excel/54818c46-b7d2-416c-a4e3-3131ab68809c
' and Wade Tai, http://msdn.microsoft.com/en-us/library/aa140225(v=office.10).aspx
' Need to set a VBA reference to "Microsoft Excel 14.0 Object Library"
' Go to the Tools Menu, and click "Reference"
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
@razorgoto
razorgoto / CleanWordFile.bas
Last active January 18, 2018 02:34
A scrubber for all hidden text and and personal information from DOC and DOCX files
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long
Sub Clean_Word_File()
'Save the current view state of ShowHiddenText and disable screen updating
Dim sView As Boolean