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!