Re: Inserting OLE Bitmap into Word document
- From: David Cleave <DavidCleave@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 06:59:04 -0700
Hi Stephen
I'm playing with that code you pointed me to but I'm having difficulties
with it.
Access is telling me it doesn't recognise the variable type tagOPENFILENAME,
an instance of which is created by the function ahtCommonFileOpenSave. Is
there a class declaration somewhere I need, or do I need to add a reference
to some library or other?
Also, will this code be portable across different versions of Windows?
Thanks again
David
"Stephen Lebans" wrote:
> The OLE Frame control has an Action method that allows you to ask it to
> copy its contents to the Clipboard.
>
> Your current course of action is the suggested method for displaying
> Images. A method to call the standard WIndows File Dialog is here:
> http://www.mvps.org/access/api/api0001.htm
>
> It looks complicated but the code is well tested.
>
> --
>
> HTH
> Stephen Lebans
> http://www.lebans.com
> Access Code, Tips and Tricks
> Please respond only to the newsgroups so everyone can benefit.
>
>
> "David Cleave" <DavidCleave@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:198D51C5-C1C3-41C5-9DDD-FBA2E3D281BC@xxxxxxxxxxxxxxxx
> > I never found a way to programmatically copy field values from Access
> onto
> > the clipboard.
> >
> > I solved this problem by ditching OLE fields altogether, and using a
> text
> > field to store the path of the image instead. I worked out how to get
> Access
> > to show the image in a form, even though it was only storing the path.
> The
> > path could then be used as an argument for Word's AddPicture method.
> I'm
> > quite happy with this solution.
> >
> > One thing that would make all this better is if I could provide the
> user
> > with a dialogue box which they can use to point Access to the filename
> of the
> > picture, instead of them having to type a filename in. Do you know of
> any way
> > I can get Access to prompt the user for a filename using a standard
> Windows
> > file dialogue?
> >
> > Thanks
> >
> > David
> >
> > "Stephen Lebans" wrote:
> >
> > > I'm just heading out the door to work but it certainly is possible.
> As
> > > you mentioned, the Clipboard route is probably the simplest
> solution.
> > > You can programmatically copy the contents of the OLE field to the
> > > Clipboard, setfocus to the Word App, Paste the current contents of
> the
> > > Clipboard, continue to loop through your records.
> > >
> > > Alternatively, you can export the contents of the OLE field to a
> disk
> > > based Jpeg file and then insert the Jpegs into the Word doc. The
> > > solution can be code to work at runtime as requried or export the
> entire
> > > table at once.
> > >
> > > --
> > >
> > > HTH
> > > Stephen Lebans
> > > http://www.lebans.com
> > > Access Code, Tips and Tricks
> > > Please respond only to the newsgroups so everyone can benefit.
> > >
> > >
> > > "David Cleave" <DavidCleave@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message
> > > news:DE71E48D-1241-4226-8FD7-2E0E9E88D543@xxxxxxxxxxxxxxxx
> > > > Hi Stephen. Thanks for asking.
> > > >
> > > > I'm come to the conclusion that it is not possible to use VB to
> insert
> > > the
> > > > contents of an OLE field into a Word document. However, it is
> possible
> > > to
> > > > change the field to contain a pathname for the object, and use
> this
> > > pathname
> > > > to place the object into a Word document.
> > > >
> > > > Cheers
> > > >
> > > > David
> > > >
> > > > "Stephen Lebans" wrote:
> > > >
> > > > > David have you worked through your issues yet?
> > > > >
> > > > > --
> > > > >
> > > > > HTH
> > > > > Stephen Lebans
> > > > > http://www.lebans.com
> > > > > Access Code, Tips and Tricks
> > > > > Please respond only to the newsgroups so everyone can benefit.
> > > > >
> > > > >
> > > > > "David Cleave" <DavidCleave@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> > > message
> > > > > news:7A7497E8-62F2-45A5-A25F-915411240F8A@xxxxxxxxxxxxxxxx
> > > > > > Hi all
> > > > > >
> > > > > > IÃf¢?Tm writing a routine which opens a new Word document and
> > > sticks
> > > > > content
> > > > > > from the current record into it. I want to put an OLE Bitmap
> from
> > > the
> > > > > current
> > > > > > record into the Word document. I am having trouble doing this.
> I
> > > have
> > > > > thought
> > > > > > of three possible ways to do this. Please advise me on them!
> > > > > >
> > > > > > WordÃf¢?Ts ActiveDocument.Shapes.AddPicture method requires a
> > > filename.
> > > > > Is there
> > > > > > a filename associated with an OLE field in Access, and can I
> get
> > > to
> > > > > it?
> > > > > >
> > > > > > Alternatively, Word provides a method to paste the contents of
> the
> > > > > clipboard
> > > > > > into the document. Does Access provide any means to copy a
> field
> > > value
> > > > > onto
> > > > > > the clipboard?
> > > > > >
> > > > > > Lastly, I could use a field in the table to store the filename
> of
> > > the
> > > > > bitmap
> > > > > > instead of storing it as OLE (enabling me to use Word's
> AddPicture
> > > > > method).
> > > > > > If I did this, is there a way I could get Access to display
> the
> > > > > picture
> > > > > > itself when the record is viewed, rather than just the
> filename?
> > > > > >
> > > > > > Thanks again
> > > > > >
> > > > > > David
> > > > >
> > > > >
> > >
> > >
>
>
.
- Follow-Ups:
- Re: Inserting OLE Bitmap into Word document
- From: Stephen Lebans
- Re: Inserting OLE Bitmap into Word document
- References:
- Inserting OLE Bitmap into Word document
- From: David Cleave
- Re: Inserting OLE Bitmap into Word document
- From: Stephen Lebans
- Re: Inserting OLE Bitmap into Word document
- From: David Cleave
- Re: Inserting OLE Bitmap into Word document
- From: Stephen Lebans
- Re: Inserting OLE Bitmap into Word document
- From: David Cleave
- Re: Inserting OLE Bitmap into Word document
- From: Stephen Lebans
- Inserting OLE Bitmap into Word document
- Prev by Date: Re: Need help with form
- Next by Date: Re: Inserting OLE Bitmap into Word document
- Previous by thread: Re: Inserting OLE Bitmap into Word document
- Next by thread: Re: Inserting OLE Bitmap into Word document
- Index(es):
Relevant Pages
|