Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6093229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:32:10+00:00 2026-05-23T12:32:10+00:00

I am using Access to send text to Word via bookmarks. I have bookmarks

  • 0

I am using Access to send text to Word via bookmarks. I have bookmarks in headers and footers, but when I try to send the text to it get the error: “Word cannot find the requested bookmark.”

I am using the following code to send text to Access

' Create a Word document from template.
Dim WordApp As Word.Application
Dim strTemplateLocation As String
Dim myVariable = “TEST!!”

' Specify location of template
strTemplateLocation = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\")) & "test.dot"

Set WordApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
    Set WordApp = CreateObject("Word.Application")
End If

WordApp.Visible = True
WordApp.WindowState = wdWindowStateMaximize
WordApp.Documents.Add Template:=strTemplateLocation, NewTemplate:=False


' Replace each bookmark with field contents.
WordApp.Selection.GoTo what:=wdGoToBookmark, Name:="myBookmark"
WordApp.Selection.TypeText myVariable

DoEvents
WordApp.Activate
Set WordApp = Nothing

I am using Office 2003 file formats.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:32:10+00:00Added an answer on May 23, 2026 at 12:32 pm

    First, you have to make sure that every Word bookmark is unique. We use Access as an automation engine for Word all the time, and this can be an easy mistake. If in doubt, delete your bookmark in your Word template and put it back in.

    Here is some code to get you on your way. Let’s start by declaring some variables, specifically a Word Document to go with your Word Application, as objects since you’re late binding.

    Dim WordApp As Object
    Dim objDoc As Object
    

    or, if you can early bind…

    Dim WordApp As Word.Application
    Dim objDoc As Word.Document
    

    Next, you know how to get set your WordApp object, but I would set my document object to give me more flexibility.

    Set objDoc = WordApp.Documents.Add Template:=strTemplateLocation, NewTemplate:=False
    

    I usually have this next section in a sub routine which I just pass in the bookmark name and value as strings. Again, you can send the same variable to as many bookmarks as you would like, but you have to have unique bookmark names in your Word template.

    If objDoc.Bookmarks.Exists(sBookmark) = True Then
    
        objDoc.Bookmarks(sBookmark).SELECT
        WordApp.Selection = sValue
    
    End If
    

    Then you seemed to have some trouble with how you found Word when you opened it up. I prefer to set things back to ‘normal’ if there is such a thing. 🙂

    With WordApp
    
        If .ActiveWindow.View.SplitSpecial <> 0 Then
            .ActiveWindow.Panes(2).Close
        End If
    
        If .ActiveWindow.ActivePane.View.Type = 1 Or .ActiveWindow.ActivePane.View.Type = 2 Then
            .ActiveWindow.ActivePane.View.Type = 3
        End If
    
        .ActiveWindow.ActivePane.View.SeekView = 0
    
    End With
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to send tweets from R, but I cannot get around
I am using Amazon SES to try and send emails via a HTTP Post
Using Access 2003 I want to get a table value from the two databases
Using Access 2003 Date Column datatype is text Table1 Date 20090528 20090529 20090530 20090502
We have an ADP project created several years ago using Access 2000. This project
I have the following problem in a Database using Access 2007 as front end
I try to send an image with the help of shareKit without using an
I have a webform where I am using TPL to send email in the
Hi i am trying to send Json via Ajax to PHP using Javascript. The
I'm using ActionMailer to send emails, but I'd like to use Sinatra's Tilt rendering.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.