Solved

Export in Word: Textmark doesn't exist

Posted on 2003-10-21
6
308 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
  • 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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

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 75 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now