Link to a Word drawing

  • Thread starter Thread starter Gary B via AccessMonster.com
  • Start date Start date
G

Gary B via AccessMonster.com

Hi all,

I hae a client who wants to produce quite a complex report with 3 different
sets of data. Each page on the report needs to be numbered as page n of n.
I have no problem with most of it, however, I'm completely flummoxed with one
part.

My client survey's sites and does a rudimentary plan (drawing) of the site in
Word (a strange choice, but he won't change it). This drawing is a part of
the final report.

Is there any way I can link the Word document containing the drawing to the
report, so that it prints out as a part of the report, thereby maintaining
the page sequence. Obviously I can insert a blank page where his Word
drawing will be and ask him to cut and paste or whatever is his preferred
option, but that is a little inelegant. I can't output the report to a Word
document because it contains photo's that are linked, so any output to Word
doesn't contain the photo's. I've tried using Bound and Unbound OLEimages,
but can't get it to work. I've run out of hair to pull out, so any help
would be much appreciated.

Many thanks,

Gary Beale
 
"I've tried using Bound and Unbound OLE images, but can't get it to work"
does not give us much to go on. I would think that OLE frames, whether
linked to an external Word file, or to a Word file stored in an OLE object,
would be appropriate for linked Word docuements. Perhaps if you were more
specific as to what you have tried and the results you got, someone could
help.

Larry Linson
Microsoft Access MVP
 
Thanks Larry for responding, and I take your point. I've not worked with OLE
frames before, so I guess I'm not really sure what the right question is.

As I understand it, if I want to link a file I have to use a bound OLE frame
and put the path to the file name in a text field (stored in an underlying
table) on the form and, I assume, the same for putting it in a report.

If we take the Form part of it only, the closest I have come to success is
with the following (although I have used a direct link rather than a text
field for the moment):

' Specify type of object.
OLEBound7.OLETypeAllowed = acOLELinked
' Specify source file.
OLEBound7.SourceDoc = "c:\FGdb\drwg1.doc"
' Create linked object.
OLEBound7.Action = acOLECreateLink
' Adjust control size.
OLEBound7.SizeMode = acOLESizeZoom

For now, I am running the code from a command button, which when run, does
insert the required document, but when I try and enter any other data, or
exit the form, it gives me an error as follows:

"The OLE server isn't registered. To register the OLE server reinstall it."

I have looked in every forum I know and also on the MS Knowledge base, and
whilst I can find references to this error, they apply to image files and
talk about associating MS Photo Editor with the relevant image files. I can
find nothing that refers to the same error with regard to .doc files.

OLE Automation is referenced. I get the same error in XP and 2003.

I can embed a document, but I would rather avoid this if I can because of db
bloat.

Thanks

Gary Beale

Larry said:
"I've tried using Bound and Unbound OLE images, but can't get it to work"
does not give us much to go on. I would think that OLE frames, whether
linked to an external Word file, or to a Word file stored in an OLE object,
would be appropriate for linked Word docuements. Perhaps if you were more
specific as to what you have tried and the results you got, someone could
help.

Larry Linson
Microsoft Access MVP
[quoted text clipped - 29 lines]
Gary Beale
 
I just realised that I needed an OLE field in the underlying table! Anyway,
now I don't get the previous error, but when the file has linked I can't
access any other fields on the form and if I try to close it I get the
following:

"You can't save the record at this time.

RMS may have encountered an error when trying to close the form. If you
close this object now, the data changes you made will be lost. Do you want to
close the database object anyway"

I'm getting closer, but not close enough.

Gary Beale

Gary said:
Thanks Larry for responding, and I take your point. I've not worked with OLE
frames before, so I guess I'm not really sure what the right question is.

As I understand it, if I want to link a file I have to use a bound OLE frame
and put the path to the file name in a text field (stored in an underlying
table) on the form and, I assume, the same for putting it in a report.

If we take the Form part of it only, the closest I have come to success is
with the following (although I have used a direct link rather than a text
field for the moment):

' Specify type of object.
OLEBound7.OLETypeAllowed = acOLELinked
' Specify source file.
OLEBound7.SourceDoc = "c:\FGdb\drwg1.doc"
' Create linked object.
OLEBound7.Action = acOLECreateLink
' Adjust control size.
OLEBound7.SizeMode = acOLESizeZoom

For now, I am running the code from a command button, which when run, does
insert the required document, but when I try and enter any other data, or
exit the form, it gives me an error as follows:

"The OLE server isn't registered. To register the OLE server reinstall it."

I have looked in every forum I know and also on the MS Knowledge base, and
whilst I can find references to this error, they apply to image files and
talk about associating MS Photo Editor with the relevant image files. I can
find nothing that refers to the same error with regard to .doc files.

OLE Automation is referenced. I get the same error in XP and 2003.

I can embed a document, but I would rather avoid this if I can because of db
bloat.

Thanks

Gary Beale
"I've tried using Bound and Unbound OLE images, but can't get it to work"
does not give us much to go on. I would think that OLE frames, whether
[quoted text clipped - 11 lines]
 
Back
Top