Using OLE data from SQL memo field

J

Jim Mahoney

(I also posted this in TechNet newsgroup inadvertently)

I haven't been able to find any documentation on how to
code this.

In an Access 2000 app, I have a Word activeX control. The
data is saved as an OLE object in a SQL Server 2000 memo
field. There is also a photo stored in another memo field.

I use Word 2000 to produce formatted documents with the
access data. I can't find the VBA syntax for placing the
OLE data into the document.

I understand the photo is some kind of inline shape, but I
don't know how to place it.

I would like the Word memo field text to appear seamlessly
with the other text the document produces.

All guidance is greatly apprciated!

Sample code for placing ordinary data field, StartDate, in
the document:

With Selection
'Session Date
'Display the Date once at the begining of each day.
If grstSP!StartDate <> datCurr Then
.SetRange Start:=.End,
End:=ActiveDocument.Content.End
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Bold = True
.Font.Size = 14
.TypeText Text:=Format(grstSP!StartDate,
gcstrDateFormat)
.ParagraphFormat.SpaceAfter = 10
.InsertParagraphAfter
End If
End With
 
W

Word Heretic

G'day "Jim Mahoney" <[email protected]>,

have you sussed out .shapes.add ?? There is all sorts room for ole
stuff in there. Essentially your object has a link to your code by
virtue of its ole tags. Your code has to be installed on the target
machine to resolve.


Jim Mahoney said:
(I also posted this in TechNet newsgroup inadvertently)

I haven't been able to find any documentation on how to
code this.

In an Access 2000 app, I have a Word activeX control. The
data is saved as an OLE object in a SQL Server 2000 memo
field. There is also a photo stored in another memo field.

I use Word 2000 to produce formatted documents with the
access data. I can't find the VBA syntax for placing the
OLE data into the document.

I understand the photo is some kind of inline shape, but I
don't know how to place it.

I would like the Word memo field text to appear seamlessly
with the other text the document produces.

All guidance is greatly apprciated!

Sample code for placing ordinary data field, StartDate, in
the document:

With Selection
'Session Date
'Display the Date once at the begining of each day.
If grstSP!StartDate <> datCurr Then
.SetRange Start:=.End,
End:=ActiveDocument.Content.End
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Bold = True
.Font.Size = 14
.TypeText Text:=Format(grstSP!StartDate,
gcstrDateFormat)
.ParagraphFormat.SpaceAfter = 10
.InsertParagraphAfter
End If
End With

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top