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
Set doc = Documents.Add
doc.Range.Text = s
End Sub

Word macro for requirement table

Need word macro to parse a doc and get all the requirements in one table

Word macro for comments

Need word macro to export comments from word into an excel sheet

Indentaion techniques in VIM

Need to explore indenatation techniques in VIM.

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

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