?
Solved

Export in Word: Textmark doesn't exist

Posted on 2003-10-21
6
Medium Priority
?
352 Views
Last Modified: 2008-03-10
I do have a form with a button to export adress into a word.dot. opening the .dot works all fine. but by placing "Name" into the word-textmark "Name", i get an error saying, that the textmark does not exist. what is wrong on my code?

 oApp.Documents.Add Template:="X:\Vorlagen\Accessbrief.dot", NewTemplate:=False, DocumentType:=0
   
    'zu Textmarke springen und Namen einfügen
   
    Set Bereich = oApp.ActiveDocument.GoTo(What:=GotoBookmark, Name:="name")
    Bereich.InsertAfter Forms!Adressanzeige!name

thx
ColumA        
0
Comment
Question by:ColumA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Ashen_Shugar
ID: 9590545

Have you tried renaming the TextMark in case Name is a reserved word?




Stephen
0
 

Author Comment

by:ColumA
ID: 9590597
Yes, Stephen, have tried several txtmarkwords.
0
 
LVL 12

Expert Comment

by:Paurths
ID: 9590621
hi, what happens if u give it a try like this:

Set Bereich = oApp.ActiveDocument.GoTo("name").Range
Bereich.InsertAfter Forms!Adressanzeige!name
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ColumA
ID: 9590728
Hi Paurths

With your solution, I get runtime-error 4120 "Wrong Parameter".

0
 
LVL 12

Accepted Solution

by:
Paurths earned 300 total points
ID: 9596728
oops... made an error, sorry
"GoTo" should be replaced by "Bookmarks"

try this


Set Bereich = oApp.ActiveDocument.Bookmarks("name").Range
Bereich.InsertAfter Forms!Adressanzeige!name
0
 

Author Comment

by:ColumA
ID: 9596953
gotcha. thank you Paurths.

Rgds
ColumA
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question