Try again - Retrieving embedded word documents from an access tabl

G

Guest

G'day
I have a table with a field setup as an oleobject into which I can save &
retrieve a word document as long as I bind the form to the table. I can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table programatically
- how do I do that & pass the object from a function to the form for display
& editing.

I use class modules to interface between the tables & any form/ report/
other manipulation. The class module handles all functions on that table
including data integrity/ save/ load/ delete/ data changed/ changes &
calculation to schedule dates etc etc. This gives me some protection against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
A

Alex Dybenko

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation
 
G

Guest

Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in dunce
speak) that I can get hold of on OLE objects etc. There is also ADO, DAO &
other goodies spoken of - which one is the current to future technology.

At the moment I am attaching tables, & using "CurrentDB" to get access to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using some
other method. (I close all objects when exiting a procedure or function

regards

Paul

Alex Dybenko said:
Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Paul Buckman said:
G'day
I have a table with a field setup as an oleobject into which I can save &
retrieve a word document as long as I bind the form to the table. I can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form for
display
& editing.

I use class modules to interface between the tables & any form/ report/
other manipulation. The class module handles all functions on that table
including data integrity/ save/ load/ delete/ data changed/ changes &
calculation to schedule dates etc etc. This gives me some protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
A

Alex Dybenko

Hi Paul,
what you can do - declare a public variable dbs as dao.database, set it to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Paul Buckman said:
Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in dunce
speak) that I can get hold of on OLE objects etc. There is also ADO, DAO &
other goodies spoken of - which one is the current to future technology.

At the moment I am attaching tables, & using "CurrentDB" to get access to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using some
other method. (I close all objects when exiting a procedure or function

regards

Paul

Alex Dybenko said:
Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Paul Buckman said:
G'day
I have a table with a field setup as an oleobject into which I can save
&
retrieve a word document as long as I bind the form to the table. I can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form for
display
& editing.

I use class modules to interface between the tables & any form/ report/
other manipulation. The class module handles all functions on that
table
including data integrity/ save/ load/ delete/ data changed/ changes &
calculation to schedule dates etc etc. This gives me some protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
G

Guest

Thanks for that Alex, now back to my original problem & maybe I did not state
it very well. My problem with my embedded word doc is not manipulating it on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a recordset,
passing it (or a reference) to a variable & causing that embedded document to
become visible on an unbound form so that it can be read/ edited etc.

Alex Dybenko said:
Hi Paul,
what you can do - declare a public variable dbs as dao.database, set it to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Paul Buckman said:
Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in dunce
speak) that I can get hold of on OLE objects etc. There is also ADO, DAO &
other goodies spoken of - which one is the current to future technology.

At the moment I am attaching tables, & using "CurrentDB" to get access to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using some
other method. (I close all objects when exiting a procedure or function

regards

Paul

Alex Dybenko said:
Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



G'day
I have a table with a field setup as an oleobject into which I can save
&
retrieve a word document as long as I bind the form to the table. I can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form for
display
& editing.

I use class modules to interface between the tables & any form/ report/
other manipulation. The class module handles all functions on that
table
including data integrity/ save/ load/ delete/ data changed/ changes &
calculation to schedule dates etc etc. This gives me some protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
A

Alex Dybenko

Hi Paul,
well, I know only way I described. But I heard that Stephen Lebans planning
to build something for this, try check his site at
http://www.lebans.com/WhatsNew.htm once a week.

also you can consider storing links to documents, or store documents in
binary format

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Paul Buckman said:
Thanks for that Alex, now back to my original problem & maybe I did not
state
it very well. My problem with my embedded word doc is not manipulating it
on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a recordset,
passing it (or a reference) to a variable & causing that embedded document
to
become visible on an unbound form so that it can be read/ edited etc.

Alex Dybenko said:
Hi Paul,
what you can do - declare a public variable dbs as dao.database, set it
to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Paul Buckman said:
Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in
dunce
speak) that I can get hold of on OLE objects etc. There is also ADO,
DAO &
other goodies spoken of - which one is the current to future
technology.

At the moment I am attaching tables, & using "CurrentDB" to get access
to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using
some
other method. (I close all objects when exiting a procedure or function

regards

Paul

:

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
G'day
I have a table with a field setup as an oleobject into which I can
save
&
retrieve a word document as long as I bind the form to the table. I
can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form for
display
& editing.

I use class modules to interface between the tables & any form/
report/
other manipulation. The class module handles all functions on that
table
including data integrity/ save/ load/ delete/ data changed/ changes
&
calculation to schedule dates etc etc. This gives me some protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
S

Stephen Lebans

It's done Alex. I'm just cleaning up the source code.

The solution supports the extraction of the following images/documents/files
without requiring the application that originally instered the object:

MS Word - doc
MS Excel - xls
MS PowerPoint - ppt (Office 2003 - Powerpoint inserts as type Package). Have
not checked other versions yet.
In fact any Office document using Structured Storage can be extracted. I
just need to know the name of the apps main Contents stream. Just Email a
sample file or open it in a Compound Document viewer.

MS Photo Editor - BMP - All Images regardless of original format are
inserted as uncompressed Bitmaps. BMP file extracted.
MS Paint - BMP - All Images regardless of original format are inserted as
uncompressed Bitmaps. BMP file extracted.

Paint Shop Pro - pps - All Images regardless of original format are inserted
as uncompressed Bitmaps within the standard PPS file. For now I am just
returning the complete PPS file. I'm writing a small reader for the PPS
format to allow for the extraction of the uncompressed Bitmap.

MISC - Any image/document/file that ends up being inserted as type Package.
The object is inserted as a Package when there is no application registered
for this file type that can function as an OLE Server to insert the object
into the OLE field.

I think that should cover the applications that were the most widely used
choices for OLE Servers within the standard Access/Windows environment. I
will also be continuing to add support for other file formats as I find
time.

Hope to get a Beta posted shortly.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Alex Dybenko said:
Hi Paul,
well, I know only way I described. But I heard that Stephen Lebans
planning to build something for this, try check his site at
http://www.lebans.com/WhatsNew.htm once a week.

also you can consider storing links to documents, or store documents in
binary format

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Paul Buckman said:
Thanks for that Alex, now back to my original problem & maybe I did not
state
it very well. My problem with my embedded word doc is not manipulating it
on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a recordset,
passing it (or a reference) to a variable & causing that embedded
document to
become visible on an unbound form so that it can be read/ edited etc.

Alex Dybenko said:
Hi Paul,
what you can do - declare a public variable dbs as dao.database, set it
to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in
dunce
speak) that I can get hold of on OLE objects etc. There is also ADO,
DAO &
other goodies spoken of - which one is the current to future
technology.

At the moment I am attaching tables, & using "CurrentDB" to get access
to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using
some
other method. (I close all objects when exiting a procedure or
function

regards

Paul

:

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
G'day
I have a table with a field setup as an oleobject into which I can
save
&
retrieve a word document as long as I bind the form to the table. I
can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form
for
display
& editing.

I use class modules to interface between the tables & any form/
report/
other manipulation. The class module handles all functions on that
table
including data integrity/ save/ load/ delete/ data changed/ changes
&
calculation to schedule dates etc etc. This gives me some
protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
G

Guest

Thanks to Alex & Stephen

I have managed to track down the exact location of the problem. After some
modifications as suggested & others, I stepped through the code in debug mode
& can read the tables via a recordset, assign the table fields to variables &
properties in the class function.

The problem occurs when I try & assign the variable to the unbound oleobject
frame. I now get the error Run-time error 438, I have downloaded microsofts
article Q236469 & see what that does.

Stephen I will be interrested to see your solution

regards

Paul

Stephen Lebans said:
It's done Alex. I'm just cleaning up the source code.

The solution supports the extraction of the following images/documents/files
without requiring the application that originally instered the object:

MS Word - doc
MS Excel - xls
MS PowerPoint - ppt (Office 2003 - Powerpoint inserts as type Package). Have
not checked other versions yet.
In fact any Office document using Structured Storage can be extracted. I
just need to know the name of the apps main Contents stream. Just Email a
sample file or open it in a Compound Document viewer.

MS Photo Editor - BMP - All Images regardless of original format are
inserted as uncompressed Bitmaps. BMP file extracted.
MS Paint - BMP - All Images regardless of original format are inserted as
uncompressed Bitmaps. BMP file extracted.

Paint Shop Pro - pps - All Images regardless of original format are inserted
as uncompressed Bitmaps within the standard PPS file. For now I am just
returning the complete PPS file. I'm writing a small reader for the PPS
format to allow for the extraction of the uncompressed Bitmap.

MISC - Any image/document/file that ends up being inserted as type Package.
The object is inserted as a Package when there is no application registered
for this file type that can function as an OLE Server to insert the object
into the OLE field.

I think that should cover the applications that were the most widely used
choices for OLE Servers within the standard Access/Windows environment. I
will also be continuing to add support for other file formats as I find
time.

Hope to get a Beta posted shortly.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Alex Dybenko said:
Hi Paul,
well, I know only way I described. But I heard that Stephen Lebans
planning to build something for this, try check his site at
http://www.lebans.com/WhatsNew.htm once a week.

also you can consider storing links to documents, or store documents in
binary format

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Paul Buckman said:
Thanks for that Alex, now back to my original problem & maybe I did not
state
it very well. My problem with my embedded word doc is not manipulating it
on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a recordset,
passing it (or a reference) to a variable & causing that embedded
document to
become visible on an unbound form so that it can be read/ edited etc.

:

Hi Paul,
what you can do - declare a public variable dbs as dao.database, set it
to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour (in
dunce
speak) that I can get hold of on OLE objects etc. There is also ADO,
DAO &
other goodies spoken of - which one is the current to future
technology.

At the moment I am attaching tables, & using "CurrentDB" to get access
to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be using
some
other method. (I close all objects when exiting a procedure or
function

regards

Paul

:

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
G'day
I have a table with a field setup as an oleobject into which I can
save
&
retrieve a word document as long as I bind the form to the table. I
can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form
for
display
& editing.

I use class modules to interface between the tables & any form/
report/
other manipulation. The class module handles all functions on that
table
including data integrity/ save/ load/ delete/ data changed/ changes
&
calculation to schedule dates etc etc. This gives me some
protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
S

Stephen Lebans

Looking over your original question, you can simply copy the Variant var
into the Value property of the Unbound OLE Frame control. I have done this
from Bound OLE Frame control to Unbound OLE Frame control. You may have to
use a hidden Bound OLE Frame control if the copy fails directly from the
Field data to the Unbound control.



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Paul Buckman said:
Thanks to Alex & Stephen

I have managed to track down the exact location of the problem. After some
modifications as suggested & others, I stepped through the code in debug
mode
& can read the tables via a recordset, assign the table fields to
variables &
properties in the class function.

The problem occurs when I try & assign the variable to the unbound
oleobject
frame. I now get the error Run-time error 438, I have downloaded
microsofts
article Q236469 & see what that does.

Stephen I will be interrested to see your solution

regards

Paul

Stephen Lebans said:
It's done Alex. I'm just cleaning up the source code.

The solution supports the extraction of the following
images/documents/files
without requiring the application that originally instered the object:

MS Word - doc
MS Excel - xls
MS PowerPoint - ppt (Office 2003 - Powerpoint inserts as type Package).
Have
not checked other versions yet.
In fact any Office document using Structured Storage can be extracted. I
just need to know the name of the apps main Contents stream. Just Email a
sample file or open it in a Compound Document viewer.

MS Photo Editor - BMP - All Images regardless of original format are
inserted as uncompressed Bitmaps. BMP file extracted.
MS Paint - BMP - All Images regardless of original format are inserted
as
uncompressed Bitmaps. BMP file extracted.

Paint Shop Pro - pps - All Images regardless of original format are
inserted
as uncompressed Bitmaps within the standard PPS file. For now I am just
returning the complete PPS file. I'm writing a small reader for the PPS
format to allow for the extraction of the uncompressed Bitmap.

MISC - Any image/document/file that ends up being inserted as type
Package.
The object is inserted as a Package when there is no application
registered
for this file type that can function as an OLE Server to insert the
object
into the OLE field.

I think that should cover the applications that were the most widely used
choices for OLE Servers within the standard Access/Windows environment. I
will also be continuing to add support for other file formats as I find
time.

Hope to get a Beta posted shortly.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Alex Dybenko said:
Hi Paul,
well, I know only way I described. But I heard that Stephen Lebans
planning to build something for this, try check his site at
http://www.lebans.com/WhatsNew.htm once a week.

also you can consider storing links to documents, or store documents in
binary format

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Thanks for that Alex, now back to my original problem & maybe I did
not
state
it very well. My problem with my embedded word doc is not manipulating
it
on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a
recordset,
passing it (or a reference) to a variable & causing that embedded
document to
become visible on an unbound form so that it can be read/ edited etc.

:

Hi Paul,
what you can do - declare a public variable dbs as dao.database, set
it
to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour
(in
dunce
speak) that I can get hold of on OLE objects etc. There is also
ADO,
DAO &
other goodies spoken of - which one is the current to future
technology.

At the moment I am attaching tables, & using "CurrentDB" to get
access
to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be
using
some
other method. (I close all objects when exiting a procedure or
function

regards

Paul

:

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
G'day
I have a table with a field setup as an oleobject into which I
can
save
&
retrieve a word document as long as I bind the form to the
table. I
can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form
for
display
& editing.

I use class modules to interface between the tables & any form/
report/
other manipulation. The class module handles all functions on
that
table
including data integrity/ save/ load/ delete/ data changed/
changes
&
calculation to schedule dates etc etc. This gives me some
protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
G

Guest

Ok, guys this is what I've tried & the errors associated, I don't understand
why it is so difficult to use this control.
************
Private Sub Command9_Click()
'Command9 is a button on a form to initiate this code.
'The form has two controls and is bound to table1
'Control1 OleBound13 is a bound object frame setup as an embedded word
document
' bound to table1.description
' - this works fine - but I cannot use this method.
'Control2 OleWordDoc is an unBound Object frame setup as an embedded word
document

Dim MySet As Recordset
Dim MyDoc As Variant
Dim strSql As String
Dim MyWordDoc As New Word.Document
Dim MyObject As Object
Dim MyCtlObject As New Control

'String used to retrieve a record (record #1 at this stage) from the database
strSql = "SELECT Table1.Description, Table1.ID " _
& " FROM Table1 WHERE (((Table1.ID)=1));"

'Retrieve the recordset, two fields 1 = ID, 2 = embedded Word doc
'gblDBS is a globally defined variable for the database object (thanks Alex)
Set MySet = gblDBS.OpenRecordset(strSql)

With MySet
If (Not .EOF) Then .MoveLast
If (Not .BOF) Then .MoveFirst

If (.RecordCount > 0) Then
MyDoc = !Description
End If
End With

'********* code works to here
Set MyObject = MySet!Description 'assignment seems to work
'Me.OLEWordDoc = MySet!Description 'gives runtime error 438 using SET has
the same effect
'Set Me.OLEWordDoc = MyObject 'gives runtime error 438
'Me.OLEWordDoc.Value = MyDoc 'gives runtime error 438
'Set Me.OLEWordDoc.Value = MyDoc 'gives runtime error 438

'Set MyCtlObject.ControlType = acObjectFrame 'gives runtime error 429
Set MyCtlObject = Me.OLEWordDoc 'works ok
'Set MyCtlObject.RowSource = MySet!Description 'gives runtime error 438

MyDoc = Me.OLEBound13.Value 'OleBound13 is a bound object frame on the form

'Me.OLEWordDoc.Value = MyDoc 'gives runtime error 438 using "SET" gives the
same error

'Set Me!OLEWordDoc.SourceDoc = MyObject 'gives runtime error 438
'Set Me.OLEWordDoc.SourceDoc = MyObject 'invalid use of property
'Set Me!OLEWordDoc.SourceDoc = MyDoc 'gives runtime error 424
Me!OLEWordDoc = MyDoc 'gives runtime error 438

Me!OLEWordDoc.Action = acOLEActivate



End Sub
***********************

Stephen Lebans said:
Looking over your original question, you can simply copy the Variant var
into the Value property of the Unbound OLE Frame control. I have done this
from Bound OLE Frame control to Unbound OLE Frame control. You may have to
use a hidden Bound OLE Frame control if the copy fails directly from the
Field data to the Unbound control.



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Paul Buckman said:
Thanks to Alex & Stephen

I have managed to track down the exact location of the problem. After some
modifications as suggested & others, I stepped through the code in debug
mode
& can read the tables via a recordset, assign the table fields to
variables &
properties in the class function.

The problem occurs when I try & assign the variable to the unbound
oleobject
frame. I now get the error Run-time error 438, I have downloaded
microsofts
article Q236469 & see what that does.

Stephen I will be interrested to see your solution

regards

Paul

Stephen Lebans said:
It's done Alex. I'm just cleaning up the source code.

The solution supports the extraction of the following
images/documents/files
without requiring the application that originally instered the object:

MS Word - doc
MS Excel - xls
MS PowerPoint - ppt (Office 2003 - Powerpoint inserts as type Package).
Have
not checked other versions yet.
In fact any Office document using Structured Storage can be extracted. I
just need to know the name of the apps main Contents stream. Just Email a
sample file or open it in a Compound Document viewer.

MS Photo Editor - BMP - All Images regardless of original format are
inserted as uncompressed Bitmaps. BMP file extracted.
MS Paint - BMP - All Images regardless of original format are inserted
as
uncompressed Bitmaps. BMP file extracted.

Paint Shop Pro - pps - All Images regardless of original format are
inserted
as uncompressed Bitmaps within the standard PPS file. For now I am just
returning the complete PPS file. I'm writing a small reader for the PPS
format to allow for the extraction of the uncompressed Bitmap.

MISC - Any image/document/file that ends up being inserted as type
Package.
The object is inserted as a Package when there is no application
registered
for this file type that can function as an OLE Server to insert the
object
into the OLE field.

I think that should cover the applications that were the most widely used
choices for OLE Servers within the standard Access/Windows environment. I
will also be continuing to add support for other file formats as I find
time.

Hope to get a Beta posted shortly.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Hi Paul,
well, I know only way I described. But I heard that Stephen Lebans
planning to build something for this, try check his site at
http://www.lebans.com/WhatsNew.htm once a week.

also you can consider storing links to documents, or store documents in
binary format

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Thanks for that Alex, now back to my original problem & maybe I did
not
state
it very well. My problem with my embedded word doc is not manipulating
it
on
a form or getting it to/ or from an ole frame in a bound form.

The problem is retrieving the oleobject from the table via a
recordset,
passing it (or a reference) to a variable & causing that embedded
document to
become visible on an unbound form so that it can be read/ edited etc.

:

Hi Paul,
what you can do - declare a public variable dbs as dao.database, set
it
to
currentdb at program startup and then use it instead of currentdb
CurrentDB can have only 250 open references, then you get this error.
here a sample code to show this:
http://alexdyb.blogspot.com/2005/12/be-careful-using-currentdb.html

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
Thanks Alex, i'll give that a go & let you know.

Is there anything available that describes the usage & behoaiour
(in
dunce
speak) that I can get hold of on OLE objects etc. There is also
ADO,
DAO &
other goodies spoken of - which one is the current to future
technology.

At the moment I am attaching tables, & using "CurrentDB" to get
access
to
them, & I keep getting "cannot open any more databases" messages,
particularly when I switch to VBA & make a change. Should I be
using
some
other method. (I close all objects when exiting a procedure or
function

regards

Paul

:

Hi Paul,
you can activate OLE field using:

Me![OLEField].Action = acOLEActivate
and then get access to word object using Me![OLEField].Object

then you can manipulate word using automation

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



message
G'day
I have a table with a field setup as an oleobject into which I
can
save
&
retrieve a word document as long as I bind the form to the
table. I
can
double clich the form field & MS Word opens with that document.

Problem is, I need to retrieve this document from the Table
programatically
- how do I do that & pass the object from a function to the form
for
display
& editing.

I use class modules to interface between the tables & any form/
report/
other manipulation. The class module handles all functions on
that
table
including data integrity/ save/ load/ delete/ data changed/
changes
&
calculation to schedule dates etc etc. This gives me some
protection
against
inadvertant data changes inherent with bound forms.

regards

Paul Buckman
 
G

Guest

Sorry guys, I found today a doc buried deep in the bowels of MSDN that says
that an unbound oleobject cannot be used for the purpose that I am
attempting. I should have been using the bound oleobject all along.

I'll see where that leads me & get back if I still have problems with a new
post.

Sincere thanks & regards
 

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