Hi,

I am adding a bookmark dynamically in word document using vb.net. All i
want is i want to set my cursor position(mouse pointer) at the end of the
bookmark text.

Here is the code i am using to create bookmark.

Dim rng As Object

rng.Text = "bookmark1 text"

Connect.applicationObject.activedocument.Bookmarks.Add("bookmark1", rng)



Any help would be appreciated

cheers

Praveen

Re: how to set the cursor(mouse pointer) at the end of the bookmark? by Dave

Dave
Tue Apr 25 06:17:33 CDT 2006

Hi,


Dim rng As Range
Set rng = Selection.Range
rng.Text = "bookmark1 text"
ActiveDocument.Bookmarks.Add "bookmark1", rng
rng.Collapse Direction:=wdCollapseEnd
rng.Select

HTH,
Dave

"praveen" <praveen@discussions.microsoft.com> wrote in message
news:9164621C-6229-466E-B7E1-EDC23BD9865E@microsoft.com...
> Hi,
>
> I am adding a bookmark dynamically in word document using vb.net. All i
> want is i want to set my cursor position(mouse pointer) at the end of the
> bookmark text.
>
> Here is the code i am using to create bookmark.
>
> Dim rng As Object
>
> rng.Text = "bookmark1 text"
>
> Connect.applicationObject.activedocument.Bookmarks.Add("bookmark1", rng)
>
>
>
> Any help would be appreciated
>
> cheers
>
> Praveen
>



Re: how to set the cursor(mouse pointer) at the end of the bookmar by praveen

praveen
Tue Apr 25 07:21:02 CDT 2006

Hi Dave,

Thanks for your reply and it did work fine. Is there any way to add extra
space at the end of the bookmark text and set the cursor over there.

for exmaple [bookmarktext] I

where I is the cursor point or mouse pointer.

Cheers

Praveen


"Dave Lett" wrote:

> Hi,
>
>
> Dim rng As Range
> Set rng = Selection.Range
> rng.Text = "bookmark1 text"
> ActiveDocument.Bookmarks.Add "bookmark1", rng
> rng.Collapse Direction:=wdCollapseEnd
> rng.Select
>
> HTH,
> Dave
>
> "praveen" <praveen@discussions.microsoft.com> wrote in message
> news:9164621C-6229-466E-B7E1-EDC23BD9865E@microsoft.com...
> > Hi,
> >
> > I am adding a bookmark dynamically in word document using vb.net. All i
> > want is i want to set my cursor position(mouse pointer) at the end of the
> > bookmark text.
> >
> > Here is the code i am using to create bookmark.
> >
> > Dim rng As Object
> >
> > rng.Text = "bookmark1 text"
> >
> > Connect.applicationObject.activedocument.Bookmarks.Add("bookmark1", rng)
> >
> >
> >
> > Any help would be appreciated
> >
> > cheers
> >
> > Praveen
> >
>
>
>

Re: how to set the cursor(mouse pointer) at the end of the bookmar by Greg

Greg
Tue Apr 25 08:31:30 CDT 2006

Sub Test()
Dim rng As Range
Set rng = Selection.Range
rng.Text = "bookmark1 text"
ActiveDocument.Bookmarks.Add "bookmark1", rng
rng.InsertAfter " "
rng.Collapse Direction:=wdCollapseEnd
rng.Select
End Sub


Re: how to set the cursor(mouse pointer) at the end of the bookmar by praveen

praveen
Tue Apr 25 09:46:02 CDT 2006

Hi Greg,

Thanks for the reply and it works fine.

"Greg Maxey" wrote:

> Sub Test()
> Dim rng As Range
> Set rng = Selection.Range
> rng.Text = "bookmark1 text"
> ActiveDocument.Bookmarks.Add "bookmark1", rng
> rng.InsertAfter " "
> rng.Collapse Direction:=wdCollapseEnd
> rng.Select
> End Sub
>
>