> hi,
> for example start is 14. lines and say 25. characters...
[quoted text clipped - 10 lines]
>
> thank you and have a nice day...
Try this
Set myRange = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(14).Range.Start + 25, _
End:=ActiveDocument.Paragraphs(14).Range.Start + 25)
You made two mistakes.
1. You didn't include an End parameter, which meant that the range would
extend to the end of the document
2. You incorrectly specified the Start parameter, not specifically
mentioning the Start property of the Range of the 14th paragraph. In the
absence of a specific property, the default property is used which is the
Text propert. Since the Text was not a number, it would have converted to
zero....

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Pu - 28 Jun 2005 10:23 GMT
Hi again, thank you
it gave that error,
"run time error 5941
the requested member of the collection doesn't exist"
when I searched in MSDN the 5941, it drives me language settings, OK my
settings didn't english US but I changed it, but no work!
that is the code
Private Sub Command1_Click()
Dim myword As Word.Application
Dim myrange As Word.Range
Set myword = CreateObject("word.application")
myword.Documents.Open "c:\qwe.doc"
myword.Visible = True
myword.Activate
Set myrange = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(14).Range.Start + 25, _
End:=ActiveDocument.Paragraphs(14).Range.Start + 25)
myrange.InsertBefore "abc"
End Sub
Jonathan West - 28 Jun 2005 10:45 GMT
In that case, is is possible that your document does not have 14 paragraphs
in it? What is the value of ActiveDocument.Range.Paragraphs.count?

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
> Hi again, thank you
> it gave that error,
[quoted text clipped - 23 lines]
>
> End Sub
Pu - 28 Jun 2005 12:04 GMT
yes here is the problem,
for example its count is 1(so clean page isn't it?), how will I insert any
text to the 14. line? or isn't it possible?
also thank you for your interest :)
Jonathan West - 28 Jun 2005 12:37 GMT
> yes here is the problem,
> for example its count is 1(so clean page isn't it?), how will I insert any
> text to the 14. line? or isn't it possible?
> also thank you for your interest :)
If there aren't 14 paragraphs in the document, then any attempt to select
the 14th paragraph is doomed to failure.
It sounds as if what you are wanting to do is insert 14 paragraphs, 25
spaces and then your text into a blank document. Can you confirm this is
what you want?

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Pu - 28 Jun 2005 14:26 GMT
yes it is what I want...
I want to type text to the line 14 and 25. spaces (for example) in a blank
page...
thank you...
Jonathan West - 28 Jun 2005 14:40 GMT
> yes it is what I want...
> I want to type text to the line 14 and 25. spaces (for example) in a blank
> page...
>
> thank you...
Dim i As Long
With ActiveDocument.Range
For i = 1 to 14
.InsertParagraphAfter
Next i
.InsertAfter Space$(25) & "abc"
End With

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Pu - 28 Jun 2005 15:06 GMT
thank you very much, it works very well...
have a nice day...