Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

how to set the cursor(mouse pointer) at the end of the bookmark?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
praveen - 25 Apr 2006 09:27 GMT
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
Dave Lett - 25 Apr 2006 12:17 GMT
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

> Hi,
>
[quoted text clipped - 15 lines]
>
> Praveen
praveen - 25 Apr 2006 13:21 GMT
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

> Hi,
>
[quoted text clipped - 27 lines]
> >
> > Praveen
Greg Maxey - 25 Apr 2006 14:31 GMT
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
praveen - 25 Apr 2006 15:46 GMT
Hi Greg,

Thanks for the reply and it works fine.

> Sub Test()
> Dim rng As Range
[quoted text clipped - 5 lines]
> rng.Select
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.