If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Export Access OLE and Attachment Data Types

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-11, 17:17
db_questions db_questions is offline
Registered User
 
Join Date: Dec 2010
Posts: 22
Export Access OLE and Attachment Data Types

All,

I have an Access 2007 database with a table with 2 fields. One field has a Data Type of OLE Object and the other has a Data Type of Attachment. I want to export the data to a table in Word. I don’t need both data types, just one, but I have been testing with both looking for something that works. I have successfully exported Text and Number Data Types but when the OLE Object Data Type is exported, the results look like gibberish, like Wingdings, as opposed to the Adobe Acrobat or Bitmap image I desire. When using the Attachment Data Type, I get a "Type mismatch" error.

Thanks for any help.

Here’s a code snippet of what I have. This already works as desired with the other data types.
-------------------------------------
Dim aWord As Word.Application
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim icount As Integer

'Heading
With aWord.Selection
.TypeText Text:="Limit"
.MoveRight Unit:=wdCell, Count:=1
End With

strSQL = .... SQL select query

Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
icount = 1

'Add data to MS Word table
Do While Not rs.EOF
With aWord.Selection
.TypeText Nz(rs![Limit])
.MoveRight Unit:=wdCell, Count:=1
End With
rsMoveNext
Loop
Reply With Quote
Reply

Tags
access 2007, attachment, export to word, ole

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On