Solved

Export in Word: Textmark doesn't exist

Posted on 2003-10-21
6
317 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
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.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

930 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

9 Experts available now in Live!

Get 1:1 Help Now