Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2008, 11:24 AM
Registered User
 
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automate bookmark creation

Hey all!

I'm after a VBA code to automatically bookmark each cell in a table with a prefix and the relevant row number, so that:
prefix = Alpha
row1 = "alpha"&"1"
row2 = "alpha"&"2"

Any help would be much appreciated!
 
Old November 12th, 2008, 04:35 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Here is a hint:

Code:
Sub Bkmk_Tables()

Dim oTable As Table
Dim i1 As Integer

If ActiveDocument.Tables.Count = 0 Then Exit Sub
Set oTable = ActiveDocument.Tables(1)

For i1 = 1 To oTable.Rows.Count

    ActiveDocument.Bookmarks.Add "Alpha" & i1, oTable.Rows(i1)
Next i1

End Sub
Cheers
Shasur

C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
error in word VBA to automate creation of mailing dgr7 Word VBA 1 April 4th, 2007 08:34 AM
Me.Bookmark = Me.RecordsetClone.Bookmark rkellogg Access VBA 5 September 8th, 2006 06:28 AM
Automate the process of creation bookmarks in word manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 1st, 2006 10:09 AM
Bookmark Style Terry Joseph Migliorino CSS Cascading Style Sheets 2 February 10th, 2006 07:52 AM
iframe bookmark problem reberman Javascript How-To 0 December 20th, 2005 12:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.