Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-18-2023, 05:30 PM
Useful Useful is offline Word VBA code unable to find Bookmark Windows 10 Word VBA code unable to find Bookmark Office 2019
Novice
Word VBA code unable to find Bookmark
 
Join Date: Jul 2023
Posts: 6
Useful is on a distinguished road
Default Word VBA code unable to find Bookmark

I am not a programmer, but I'm trying to help a friend with document automation.



In a Word letter, I have constructed a Dialogue Box and the VBA code uses Bookmarks to go to specific areas and populate the letter with data entered in the Dialogue Box.

This works fine on the first page. The problem is on the second page, where a Page Break is inserted by VBA code and the Header contains two Bookmarks.

The plan is to go to the first Bookmark and insert text from the Dialogue Box, but the VBA code displays an error that it can't find the Bookmark.

I can find that Bookmark manually in that Word document fine, so I don't know what I'm doing wrong.

The code is:

Selection.GoTo What:=wdGoToBookmark, Name:="Name1"
Selection.TypeText Text:=txtName.Text

I would be grateful for your help.

Regards
Useful
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
REf Fields show Bookmark whole cell when Bookmark is created by code. pmcpowell Word VBA 2 11-16-2019 07:05 PM
How do I code bookmark globally for different template? Yong Xiang Word VBA 17 02-06-2019 01:09 PM
Word VBA code unable to find Bookmark Field Code: Show a value only if bookmark is not empty Cosmo Word 7 08-24-2018 01:46 PM
Word VBA code unable to find Bookmark Find word, Insert Paragraph and bookmark gattaca714 Word VBA 2 03-24-2017 09:23 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 10:24 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