Inserting Bookmarks and Text into a Word Document 
Author Message
 Inserting Bookmarks and Text into a Word Document


Thanks to all that reply.

I am attempting to write some VBScript that will insert bookmarks into a
Word document. The Bookmarks have to appear at the Top of the document like

[] Forename
[] Initits
[] Surname

..... rest of Word Document.

However I fear I am doing this totally wrong. As my bookmarks get embedded
inside one another and it looks a real mess. I am using the Word.Application

The code is:

Set MyRange1 = objWrdDoc.Paragraphs(1).range

   while Index < m2len
        with objWrdDoc.Bookmarks
            call .add("at" & (Index + 1), MyRange1)
            .DefaultSorting = wdSortByName
           .ShowHidden = False
        End With
        MyRange1.InsertBefore = (MsgIn.toMerge.options(Index).text & chr(10)
& chr(13))
        Index = Index + 1

Can anybody point out to me what I am doing wrong here


Stuart MacCallum

Sun, 27 Jul 2003 20:37:35 GMT  
 [ 1 post ] 

 Relevant Pages 

1. INSERT text into WORD document

2. Error inserting text into MS Word Document

3. Inserting Word Documents into SQL Server Text Field

4. Office XP only: Spurious bookmark added to Word document Automating Powerpoint from Word

5. Macro to insert text or document into active document

6. word macro to remove select bookmarks in a document

7. Opening a word document and scrollling to a bookmark

8. Insert a formatted value in a Word template bookmark

9. Insert a Word BookMark from Access, How

10. Inserting text at Bookmark location

11. Inserting text into bookmark

12. Insert Text at bookmark


Powered by phpBB® Forum Software