The Script Library
Menu
The Script Library
Browse
Search
Submit
Reference
About
Contact

Link to Us
Index
Display

Home VBScript Microsoft Office Microsoft Word




Modify Bookmark Text in a Word Document

 

Description
Demonstration script that changes the text of two different bookmarks in an existing Microsoft Word document.

 

Author/Submitter
Microsoft Scripting Guys

 

Supported Platforms

Windows Server 2003

Yes

Windows XP

Yes

Windows 2000

Yes

Windows NT 4.0

Yes

Windows 98

Yes



 

VBScript Code


Set objWord = CreateObject("Word.Application") objWord.Caption = "Test Caption" objWord.Visible = True Set objDoc = objWord.Documents.Open("c:\scripts\word\bookmarkdoc.doc") Set objRange = objDoc.Bookmarks("NameBookmark").Range objRange.Text = "Bob" Set objRange = objDoc.Bookmarks("AddressBookmark").Range objRange.Text = "999"

Was this helpful? If so, Please Share it by clicking a button on the left the screen..






Search The Library


Search String

Script Language