Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2004, 08:50 AM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access OLE to Word

I have a database (Access97)in which the table "T_EXERCISES" includes a OLE object Field (OLE_VIEW). I store Word Docs (embedded) in that field. After i put search criteria on a form there is a query which takes the results. All I want to do is export the docs from the query to Word.
I've tried with Publish, Merge but I get null. I think that the problem is that I can't pass through the content of the object (the formated text of the Word docs) so I could simply Copy-Paste it.
What is wrong with the code below?
Why it isn't working?

Dim objWord As Word.Application
Dim objDoc As Object
Dim rCust As Recordset
Dim dbase As Database

Set dbase = CurrentDb()
Set rCust = dbase.OpenRecordset("q_SearchList")

Set objWord = New Word.Application
objWord.Visible = True
Set objDoc = objWord.Documents.Add

objWord.Selection.Text = rCust("OLE_VIEW")
rCust.MoveNext
....


Sorry for my English, it's foreign to me.




GregoryHu





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading a word document into an OLE container gpfeifer Pro VB 6 0 March 16th, 2005 06:17 PM
Connecting to Access via OLE-DB mairejo Access 3 October 26th, 2004 02:28 PM
Access OLE skareem Classic ASP Databases 1 August 30th, 2004 06:30 AM
OLE Automation Access - Word william.murray Access 2 July 13th, 2004 07:23 AM
Access OLE Merge to Word GregoryHu Access VBA 5 May 7th, 2004 10:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.