Showing posts with label MSWORD. Show all posts
Showing posts with label MSWORD. Show all posts

Wednesday, January 31, 2007

Word macro to export comments

' This macro will export all the comments in the word doc to a new word doc.
' U can save the word doc as .txt.
' Change the extension to .csv
' Open the doc with excel and u have exported your comments to excel
Sub ExportComment()
Dim s As String
Dim cmt As Word.Comment
Dim doc As Word.Document
For Each cmt In ActiveDocument.Comments
s = s & cmt.Initial & cmt.Index & "," & cmt.Range.Text & vbCr
Next
Set doc = Documents.Add
doc.Range.Text = s
End Sub

Friday, January 05, 2007

MSWORD: Macro to add cross reference

Sub CreateCR()
' CreateCR Macro
' Macro recorded 1/5/2007 by Jay
' This macro converts selection copy to a cross reference - numbered item

Selection.Copy
Dim crossref
crossref = Selection
'MsgBox (crossref)
Dim pNumberedItem
pNumberedItem = ActiveDocument.GetCrossReferenceItems(wdRefTypeNumberedItem) For i = 1 To UBound(pNumberedItem)
'MsgBox (pNumberedItem(i))
If Selection = Trim(pNumberedItem(i)) Then
Selection.InsertCrossReference ReferenceType:="Numbered item", _ ReferenceKind:=wdNumberNoContext, ReferenceItem:= i, _
InsertAsHyperlink:=True, IncludePosition:=False
Exit For
End If
Next i
End Sub

Tuesday, December 26, 2006

MSWORD: Macro for Document Map

Word Macro to toggle Document Map using [control - D]. You can map this macro with [control-D] and then can hide/unhide document map using [control-D]. Remember that document maps are major reason for crash while saving doc, so take care that you unhide it while saving docs.

Sub DocumentMap()

If (ActiveWindow.DocumentMap) Then
ActiveWindow.DocumentMap = False
Else
ActiveWindow.DocumentMap = True
End If

End Sub