Arvind,
See if this subroutine does what you want.
Public Sub FindNoDataLocation()
Dim myDoc As Word.Document
Dim aParagraph As Word.Paragraph
Dim aRange As Word.Range
Set myDoc = ActiveDocument
For Each aParagraph In myDoc.Paragraphs
If InStr(aParagraph.Style, "Heading 1") <> 0 _
Or InStr(aParagraph.Style, "Heading 2") <> 0 Then
Set aRange = aParagraph.Range
aRange.Move Unit:=wdParagraph, Count:=1
aRange.Expand Unit:=wdParagraph
If aRange.Characters.Count = 1 Then
aRange.Collapse
aRange.InsertBefore "TBC"
aRange.Font.Animation = wdAnimationMarchingRedAnts
ElseIf InStr(aRange.Paragraphs(1).Style, "Heading ") <> 0 Then
Set aRange = aParagraph.Range
aRange.Collapse Direction:=wdCollapseEnd
aRange.Move Unit:=wdCharacter, Count:=-1
aRange.Select
With Selection
.TypeParagraph
.TypeText "TBC"
.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
End With
Set aRange = Selection.Range
aRange.Font.Animation = wdAnimationMarchingRedAnts
End If
End If
Next aParagraph
End Sub
> Hi Guys,
> I think I have put a sample copy of my document
[quoted text clipped - 39 lines]
>>> 1.1 Subheading
>>> not blank <no change>

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Arry Potter - 30 Jul 2007 12:20 GMT
THANKS ALL IT SOLVED MY PROBLEM. RUSS,OLDMAN ARE THE BEST!