Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: 21 Oct 2005 11:52:29 -0700,    group: microsoft.public.word.word97vba        back       


How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
Word has a command that is shown when a graphic is selected. Select
Layout and the last command: Reduce?? graphic. A dialog is displayed in
which I can select 'Reduce all graphics' and 'Screen or printer
resolution'.

How can I perform this file size reduction macrowise? A recorded macro
looks like this:

    Selection.InlineShapes(1).Fill.Visible = msoFalse
    Selection.InlineShapes(1).Fill.Solid
    Selection.InlineShapes(1).Fill.Transparency = 0#
    Selection.InlineShapes(1).Line.Weight = 0.75
    Selection.InlineShapes(1).Line.Transparency = 0#
    Selection.InlineShapes(1).Line.Visible = msoFalse
    Selection.InlineShapes(1).LockAspectRatio = msoTrue
    Selection.InlineShapes(1).Height = 682#
    Selection.InlineShapes(1).Width = 453.85
    Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
    Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
    Selection.InlineShapes(1).PictureFormat.ColorType =
msoPictureAutomatic
    Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
    Selection.InlineShapes(1).PictureFormat.CropRight = 0#
    Selection.InlineShapes(1).PictureFormat.CropTop = 0#
    Selection.InlineShapes(1).PictureFormat.CropBottom = 0#

And I guess that is not what I need.

Thanks!

Please send a cc to hanslist@speedpost.not (not-is-net)

Hans List
date: 21 Oct 2005 11:52:29 -0700   author:   Hans List

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
Word is a very poor picture editor. Among other things, it normally stores 
both the original picture and any modifications, so using Word to shrink 
graphics or change the resolution will normally give you larger, not 
smaller, files. Not sure that this is the case when the changes are made 
through vba, but I would be surprised if not. Cropping a picture does not 
reduce it but cuts off edges.
-- 
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
 --------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Hans List"  wrote in message 
news:1129920749.043913.259760@g43g2000cwa.googlegroups.com...
> Word has a command that is shown when a graphic is selected. Select
> Layout and the last command: Reduce?? graphic. A dialog is displayed in
> which I can select 'Reduce all graphics' and 'Screen or printer
> resolution'.
>
> How can I perform this file size reduction macrowise? A recorded macro
> looks like this:
>
>    Selection.InlineShapes(1).Fill.Visible = msoFalse
>    Selection.InlineShapes(1).Fill.Solid
>    Selection.InlineShapes(1).Fill.Transparency = 0#
>    Selection.InlineShapes(1).Line.Weight = 0.75
>    Selection.InlineShapes(1).Line.Transparency = 0#
>    Selection.InlineShapes(1).Line.Visible = msoFalse
>    Selection.InlineShapes(1).LockAspectRatio = msoTrue
>    Selection.InlineShapes(1).Height = 682#
>    Selection.InlineShapes(1).Width = 453.85
>    Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
>    Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
>    Selection.InlineShapes(1).PictureFormat.ColorType =
> msoPictureAutomatic
>    Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
>    Selection.InlineShapes(1).PictureFormat.CropRight = 0#
>    Selection.InlineShapes(1).PictureFormat.CropTop = 0#
>    Selection.InlineShapes(1).PictureFormat.CropBottom = 0#
>
> And I guess that is not what I need.
>
> Thanks!
>
> Please send a cc to hanslist@speedpost.not (not-is-net)
>
> Hans List
>
date: Fri, 21 Oct 2005 14:14:27 -0500   author:   Charles Kenyon

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
"Charles Kenyon"  schreef
in bericht news:%23cqvoOn1FHA.3060@TK2MSFTNGP10.phx.gbl...
> Word is a very poor picture editor. Among other things, it normally
stores
> both the original picture and any modifications, so using Word to
shrink
> graphics or change the resolution will normally give you larger, not
> smaller, files. Not sure that this is the case when the changes are
made
> through vba, but I would be surprised if not. Cropping a picture
does not
> reduce it but cuts off edges.

It actually does shrink the files, Charles.

Just shrunk a 57 MB manual with loads of (cropped) photos to 7 MB by
using the menu commands I described.

Now I'd like to do this macrowise.

Hans List
date: Fri, 21 Oct 2005 22:36:49 +0200   author:   Hans List hanslist@speedpostnet

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
> It actually does shrink the files, Charles.
>
> Just shrunk a 57 MB manual with loads of (cropped) photos to 7 MB by
> using the menu commands I described.
>
> Now I'd like to do this macrowise.

I could always try to create a workaround using Sendkeys but this is
not the elegant way.

So I'm looking for something like:

For n = 1 to NumberOfShapes
    Activedocument.Inlineshape(n).Compress
Next n

Hans List
date: Sat, 22 Oct 2005 09:51:15 +0200   author:   Hans List hanslist@speedpostnet

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
Hans List was telling us:
Hans List nous racontait que :

>> It actually does shrink the files, Charles.
>>
>> Just shrunk a 57 MB manual with loads of (cropped) photos to 7 MB by
>> using the menu commands I described.
>>
>> Now I'd like to do this macrowise.
>
> I could always try to create a workaround using Sendkeys but this is
> not the elegant way.

I guess this is what you are going to have to do!

> So I'm looking for something like:
>
> For n = 1 to NumberOfShapes
>    Activedocument.Inlineshape(n).Compress
> Next n

I could not fin a built-in command or a way to call the dialog directly with 
Application.Dialogs.

All I found was a way to call the dialog from a button when customizing the 
toolbar (Tools > Customize > "Commands" tab, "Drawing" categories and 
"Compress pictures..." command.

BTW, not all Word commands/functions are exposed through VBA. Some things, 
like this compression utility, are not available.



-- 
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
date: Sun, 23 Oct 2005 21:04:17 -0400   author:   Jean-Guy Marcil NoSpam@LeaveMeAlone

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
"Jean-Guy Marcil" <NoSpam@LeaveMeAlone> schreef in bericht
news:uKFrabD2FHA.2212@TK2MSFTNGP15.phx.gbl...
.....

> All I found was a way to call the dialog from a button when
customizing the
> toolbar (Tools > Customize > "Commands" tab, "Drawing" categories
and
> "Compress pictures..." command.
>
> BTW, not all Word commands/functions are exposed through VBA. Some
things,
> like this compression utility, are not available.

That really is a pity (because I'd like to write a macro that
compresses loads of files in many folders).

Thanks for looking into it!

Bonjour,

Hans List
date: Mon, 24 Oct 2005 09:25:25 +0200   author:   Hans List hanslist@speedpostnet

Re: How to make files with lots of graphics smaller: I know how to manually, but macrowise?   
Hi Hans,

If you cut & re-paste a picture that has been cropped, the re-pasted version
will no longer have the cropped portion, which should theoretically reduce
the required file size. Sometimes it'll increase because of a change in
storage format.

Scaling the picture down before cutting & pasting, then enlarging it again
to its former size will also reduce the image's storage requirements, at a
cost of resolution.

If you cut and paste the picture a second time, Word lets you choose a
format such as jpeg, gif or png, which should reduce the file size still
further.

Cheers


"Hans List" <hanslist@speedpostnet> wrote in message
news:uMvQbwG2FHA.3560@TK2MSFTNGP15.phx.gbl...
>
> "Jean-Guy Marcil" <NoSpam@LeaveMeAlone> schreef in bericht
> news:uKFrabD2FHA.2212@TK2MSFTNGP15.phx.gbl...
> ....
>
> > All I found was a way to call the dialog from a button when
> customizing the
> > toolbar (Tools > Customize > "Commands" tab, "Drawing" categories
> and
> > "Compress pictures..." command.
> >
> > BTW, not all Word commands/functions are exposed through VBA. Some
> things,
> > like this compression utility, are not available.
>
> That really is a pity (because I'd like to write a macro that
> compresses loads of files in many folders).
>
> Thanks for looking into it!
>
> Bonjour,
>
> Hans List
>
>
date: Mon, 24 Oct 2005 22:53:08 +1000   author:   macropod lid

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us