|
-
May 15th, 2000, 06:26 AM
#1
Thread Starter
New Member
Okay, Im using Microsoft Access but the coding i need to use is all visual basic stuff. I've been able to do what im about to explain but somehow the code got deleted. I have a form which has fields for a contact. eg, first name, last name, address, city, etc. I have a button that when its clicked, microsoft word will open a letter on the a:\ which has several BOOKMARKS on it. Named, First, Last, Address..etc..i had it so that whatever record the user was viewing, when the button was clicked, the contacts address information was inserted over the bookmarks in the letter. Not sure if people understand that but i did it before.
my code looks like this so far...
Dim objWord As Object
Set objWord = CreateObject("Word.Basic")
objWord.AppShow
objWord.FileOpen ("a:letter.doc")
but now i need the code to replace each bookmark. For example, the field FirstName, would replace the bookmark First in the letter. And the field LastName would replace the bookmark Last.
Please help if you can.
-Stephen
-
May 16th, 2000, 08:25 AM
#2
Hyperactive Member
This returns the bookmarks in a document by order of placement:
Code:
Sub GetBookMarksByPlacement()
Dim bmBookMark As Bookmark
For Each bmBookMark In ActiveDocument.Range.Bookmarks
MsgBox bmBookMark.Name
Next
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|