Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2021, 12:10 AM
TheBigBoss TheBigBoss is offline Add footnote in a bookmark Windows 7 32bit Add footnote in a bookmark Office 2010 32bit
Advanced Beginner
Add footnote in a bookmark
 
Join Date: Dec 2016
Posts: 56
TheBigBoss is on a distinguished road
Default

Thanks Guessed for your reply. Well, I have failed.



Here a simpler macro.

Code:
Option Explicit
Sub BMTest()
 Dim tmp As String
 tmp = "2021"
 WB "BM1", tmp
 tmp = "52"
 WB "BM2", tmp
 tmp = "10x"
 WB "BM3", tmp
 
 tmp = "2021"
 WB "BM4", tmp
 tmp = "52"
 WB "BM5", tmp
 tmp = "10x"
 WB "BM6", tmp
End Sub

Public Sub WB(ByVal BName As String, ByVal inhalt As String)
 If ActiveDocument.Bookmarks.Exists(BName) Then
 Dim r As Range
 Set r = ActiveDocument.Bookmarks(BName).Range
 r.Text = inhalt
 ActiveDocument.Bookmarks.Add BName, r
 Else
 Debug.Print "Bookmark not found: " & BName
 End If
End Sub

In word, copy the following and insert the bookmarks
Code:
/* This works (note the space)*/
KTP.EG.[BM1] [BM2] [BM3]

/* This fails */
KTP.EG.[BM4][BM5][BM6]
This is my result.

Code:
KTP.EG.2021 52 10x
KTP.EG.10x
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add footnote in a bookmark Footnote references in the footnote section losing their style when cut+pasted from same doc emblaw Word 4 12-08-2020 06:23 AM
Add footnote in a bookmark Removing line break and indentation between footnote number and footnote text in Word jaanross Word 5 02-06-2020 12:04 AM
REf Fields show Bookmark whole cell when Bookmark is created by code. pmcpowell Word VBA 2 11-16-2019 07:05 PM
Add footnote in a bookmark Adding footnote number as part of footnote text NoCalScribe Word VBA 3 07-15-2019 07:20 PM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft