Need Word VBA Help to Create Bmp

K

KenWilson1000

Hi. I have a Word doc which consists of of some paragraphs of text,
tables, and a few inserted pictures. The contents of this Word doc
are constantly changing. My aim is to copy all of its contents as a
single bmp file, and then paste this bmp file into an Excel xls file.

The steps I've used to try to do this manually are:
(1) Ctrl & A (select all)
(2) Ctrl & C (copy)
(3) place my cursor at the desired location on the Excel file and
use Edit > Paste Special - Picture (Enhanced Metafile).

The resulting paste into Excel does include all the text and table info
but not any of the pictures. I am hoping for the means to get a
"complete" copy and paste (that includes any inserted pictures from
the Word doc), and the proper Word VBA code to do this.

I know the Word VBA for steps 1 and 2 are:

Selection.WholeStory
Selection.Copy

Since the second line of code above does not perform a
"complete" copy, I'm sure that line will have to be changed.

Could you please tell me what the proper code would be to
achieve this? I would be most appreciative for your help.

(By the way. To me it is "odd" that this can be easily done from
Excel into Word. In Excel, if you paint in an area while holding
down the Shift key, you will be able to copy any of its contents
(including bitmaps) and then paste this as a single bitmap
into Word. I say "odd", because I would have thought this to be
a simple matter going from Word into Excel.)

I look forward to your answers and you have my sincere thanks.

God bless you.

Ken Wilson
 
C

Cindy M -WordMVP-

Hi Ken

Word can store pictures in one of two ways: inline with the text (it's
treated like a text character) and with text-flow formatting. I'm
guessing your pictures may be of the latter type, and this could be
what's causing the problem.

Create a new Word file, with a bit of text, then insert a picture from
file. Right click, choose "Format [whatever]" and on the Layout tab
select "Inline with text".

Now see if copying and pasting into Excel as a metafile gives you a
picture in the result?
. I have a Word doc which consists of of some paragraphs of text,
tables, and a few inserted pictures. The contents of this Word doc
are constantly changing. My aim is to copy all of its contents as a
single bmp file, and then paste this bmp file into an Excel xls file.

The steps I've used to try to do this manually are:
(1) Ctrl & A (select all)
(2) Ctrl & C (copy)
(3) place my cursor at the desired location on the Excel file and
use Edit > Paste Special - Picture (Enhanced Metafile).

The resulting paste into Excel does include all the text and table info
but not any of the pictures. I am hoping for the means to get a
"complete" copy and paste (that includes any inserted pictures from
the Word doc), and the proper Word VBA code to do this.

I know the Word VBA for steps 1 and 2 are:

Selection.WholeStory
Selection.Copy

Since the second line of code above does not perform a
"complete" copy, I'm sure that line will have to be changed.

Could you please tell me what the proper code would be to
achieve this? I would be most appreciative for your help.

(By the way. To me it is "odd" that this can be easily done from
Excel into Word. In Excel, if you paint in an area while holding
down the Shift key, you will be able to copy any of its contents
(including bitmaps) and then paste this as a single bitmap
into Word. I say "odd", because I would have thought this to be
a simple matter going from Word into Excel.)

I look forward to your answers and you have my sincere thanks.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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