473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Exporting Pictures to .rtf

Hello,

I have an ole object in my database that contains mostly pictures. I
have this field in a report that I need to export to MS Word. When I
export the report, I get everything accept the picture. What am I
doing wrong?

Thanks,Lisa
Nov 12 '05 #1
4 12991
You're not doing anything wrong: Access doesn't export pictures to .rtf. (My
understanding is that there are different "levels" of .rtf, and Access uses
the lowest level, so as to be most compatible).

If you don't need to be able to update the .rtf files, check what Stephen
Lebans has at http://www.lebans.com/ReportUtilities.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Lisa" <ln********@citlink.net> wrote in message
news:14**************************@posting.google.c om...
Hello,

I have an ole object in my database that contains mostly pictures. I
have this field in a report that I need to export to MS Word. When I
export the report, I get everything accept the picture. What am I
doing wrong?

Thanks,Lisa

Nov 12 '05 #2
Nothing

For some unknown reason Access does not export graphic elements of a report
to RTF.

"Lisa" <ln********@citlink.net> wrote in message
news:14**************************@posting.google.c om...
Hello,

I have an ole object in my database that contains mostly pictures. I
have this field in a report that I need to export to MS Word. When I
export the report, I get everything accept the picture. What am I
doing wrong?

Thanks,Lisa

Nov 12 '05 #3
This is doable but coding intensive. After you pass your data in RTF
format, you need to add bookmarks to where you want to place your
pictures. This is the easy part. You can do this with automation:
Here is some sample code for the Word VBA part that you can do from
Access:

Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdLine, Count:=28
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="pic"

You have to make a reference to the Word Library (goto Tools References
in any code module in Access) then create some vars like Dim wrdObj as
Word.Application, wrdDoc as Word.Document

Set wrdObj = CreateObject("Word.Application")
Set wrdDoc = wrdObj.Documents.Open("C:\somedoc.doc")
wrdDoc.Selection...

After you add the bookmarks, then you have to copy the respective
picture to memory and paste it in word at the corresponding bookmark.
The copy the picture part is the hard part. You could use API code
(quite cumbersome) or you could write an ActiveX control in VB6 (an OCX
or ActiveX Dll) which uses VB's copymode (not available in Access for
some reason). This is actually simpler than using the API code (because
I don't have the API code to copy a picture, just text).

Either way, if you are passing data in RTF format to Word, passing
pictures won't be fun. Another thing you could do is to create a
Template like Word Doc and plant a bunch of bookmarks on it, then pass
the data through Automation, wrdObj, wrdDoc. You could actually write
the code modules in the Word Document and invoke them from wrdDoc

wrdDoc.Application.Run "DataTransfer"

Say your Word subroutine is called "DataTransfer". You coudl use an ADO
or DAO recordset to populate the document and use an Image control
inside the Word Doc to display your images. This would really be a more
realistic approach if you really need to have pics in your doc.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4
You might want to investigate XpertDoc as an alternative solution. It
creates genuine MS-Word documents without making any call to the
MS-Word application, making it more reliable, much faster and easier
to deploy and support.

The easiest way to get the picture from your database to the word
document through the XpertDoc template is to save the picture on disk
and create a link to it using the following procedure:

1. Create an XpertDoc Expression (a "blue" field).

2. In the "Code" section, put the following expression:
XdInsertPictureLinkRTF(<picture file path>)
For example: XdInsertPictureLinkRTF("C:\YourPicsFolder\YourPicN ame.jpg")

3. Change the format of the XD Expression to "RTF" (using the "Format"
combo
box that lies below the "Code" section).

You can download this tool from www.xpertdoc.com.
Rich P <rp*****@aol.com> wrote in message news:<3f*********************@news.frii.net>...
This is doable but coding intensive. After you pass your data in RTF
format, you need to add bookmarks to where you want to place your
pictures. This is the easy part. You can do this with automation:
Here is some sample code for the Word VBA part that you can do from
Access:

Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdLine, Count:=28
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="pic"

You have to make a reference to the Word Library (goto Tools References
in any code module in Access) then create some vars like Dim wrdObj as
Word.Application, wrdDoc as Word.Document

Set wrdObj = CreateObject("Word.Application")
Set wrdDoc = wrdObj.Documents.Open("C:\somedoc.doc")
wrdDoc.Selection...

After you add the bookmarks, then you have to copy the respective
picture to memory and paste it in word at the corresponding bookmark.
The copy the picture part is the hard part. You could use API code
(quite cumbersome) or you could write an ActiveX control in VB6 (an OCX
or ActiveX Dll) which uses VB's copymode (not available in Access for
some reason). This is actually simpler than using the API code (because
I don't have the API code to copy a picture, just text).

Either way, if you are passing data in RTF format to Word, passing
pictures won't be fun. Another thing you could do is to create a
Template like Word Doc and plant a bunch of bookmarks on it, then pass
the data through Automation, wrdObj, wrdDoc. You could actually write
the code modules in the Word Document and invoke them from wrdDoc

wrdDoc.Application.Run "DataTransfer"

Say your Word subroutine is called "DataTransfer". You coudl use an ADO
or DAO recordset to populate the document and use an Image control
inside the Word Doc to display your images. This would really be a more
realistic approach if you really need to have pics in your doc.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JakeC | last post by:
Hey all, I'm currently redesigning a website that a friend and I started about a year ago. It is a daily surf report so when choosing the best script/language to use for the new design, I found...
1
by: Alban Gerome | last post by:
Hi there, I'm trying to export a pictures table, my mySQL database table already exists so I have linked both tables in Access and I tried to run a simple append query in Access to export the...
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
4
by: Dom Hicklin | last post by:
I have created a form onto which images can be dropped and thus added to the OLE field of a Table (Access 2000 linked to SQL 2000 server). I use the Stephen Lebans ExportOLE function to do this...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
1
by: bungle | last post by:
Hi Does anyone have any suggestions for exporting a datagridview which includes graphics to excel? I know it is relatively simple to do a normal export, but the fact that I have images in the...
4
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.