Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display optionField values in Word

Status
Not open for further replies.

peterworm

Programmer
Aug 4, 2003
14
DE
Hi,
I'm using the following code to fill a Word document with values from Access. So far, so good. But is it possible, to display the values from option fields in a word document.
The option values are 1,2, or 3 and so on.
Example:
very good good bad
---------------------------------------------------------
Service X
---------------------------------------------------------
Presentation X
---------------------------------------------------------
Knowhow X
---------------------------------------------------------
*** Code start
Private Sub cmdLetter_Click()

Dim wrdApp As New Word.Application
Dim wrdDoc As Word.Document
Dim wrdPositions As Word.Bookmarks

Set wrdDoc = wrdApp.Documents.Add("AccessToWord")
Set wrdPositions = wrdDoc.Bookmarks

With wrdPositions
.Item("Adress").Range.Text = Me.FirstName & " " & Me.LastName
.Item("Strreet").Range.Text = Me.Street
.Item("City").Range.Text = Me.ZipCode & " " & Me.City
.Item("Date").Range.Text = CStr(Date)
End With

wrdApp.Visible = True
wrdApp.Activate End Sub
**** Code end

Thank you for any help,
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top