Reply
 
Thread Tools Display Modes
  #1   Report Post  
JethroUK©
 
Posts: n/a
Default Paste Special>Picture?

Anyone know what 'type' of picture file this method produces? - I need to
reproduce this command in V.Basic. (it doesn't work in recorded macro)


  #2   Report Post  
Jean-Guy Marcil
 
Posts: n/a
Default

JethroUK© was telling us:
JethroUK© nous racontait que :

Anyone know what 'type' of picture file this method produces? - I
need to reproduce this command in V.Basic. (it doesn't work in
recorded macro)


Have you looked at the PasteSpecial method in the VBA help?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org


  #3   Report Post  
JethroUK©
 
Posts: n/a
Default

it specifies other picture types (jpegs, bitmaps,etc) - but not which type
of picture as defined by pastespecial/'picture' - i think it's metafile


"Jean-Guy Marcil" NoSpam@LeaveMeAlone wrote in message
...
JethroUK© was telling us:
JethroUK© nous racontait que :

Anyone know what 'type' of picture file this method produces? - I
need to reproduce this command in V.Basic. (it doesn't work in
recorded macro)


Have you looked at the PasteSpecial method in the VBA help?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org




  #4   Report Post  
Jean-Guy Marcil
 
Posts: n/a
Default

JethroUK© was telling us:
JethroUK© nous racontait que :

it specifies other picture types (jpegs, bitmaps,etc) - but not which
type of picture as defined by pastespecial/'picture' - i think it's
metafile


The definition is:

PasteSpecial(IconIndex, Link, Placement, DisplayAsIcon, DataType,
IconFileName, IconLabel)
The datatype is the one you want.

The problem is that the available DataTypes depend on the clipboard content.
If the clipboard contains a picture, you can use "15" as DataType to paste a
JPEG format. But if the clipboard contains text, this DataType will generate
an error. The metafile format (wdPasteMetafilePicture or "3") always works,
I think, regardless of the clipboard content. So if you cannot control what
a user has put in the clipboard, then use that DataType. Otherwise, you have
to check the clipboard content, then, based on the content, use a different
DataType. If you need to go that way, let us know, code to test the
Clipboard content can be posted. But first, ask yourself if you really need
to specify the picture type in Word....

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org


  #5   Report Post  
JethroUK©
 
Posts: n/a
Default

You've confirmed my suspicions - i read the type of the picture i wanted,
and it was '3' - which from your findings = wdPasteMetafilePicture

many thanks


"Jean-Guy Marcil" NoSpam@LeaveMeAlone wrote in message
...
JethroUK© was telling us:
JethroUK© nous racontait que :

it specifies other picture types (jpegs, bitmaps,etc) - but not which
type of picture as defined by pastespecial/'picture' - i think it's
metafile


The definition is:

PasteSpecial(IconIndex, Link, Placement, DisplayAsIcon, DataType,
IconFileName, IconLabel)
The datatype is the one you want.

The problem is that the available DataTypes depend on the clipboard

content.
If the clipboard contains a picture, you can use "15" as DataType to paste

a
JPEG format. But if the clipboard contains text, this DataType will

generate
an error. The metafile format (wdPasteMetafilePicture or "3") always

works,
I think, regardless of the clipboard content. So if you cannot control

what
a user has put in the clipboard, then use that DataType. Otherwise, you

have
to check the clipboard content, then, based on the content, use a

different
DataType. If you need to go that way, let us know, code to test the
Clipboard content can be posted. But first, ask yourself if you really

need
to specify the picture type in Word....

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org






  #6   Report Post  
JethroUK©
 
Posts: n/a
Default

The problem i have is really simple but i'm not finding it easy to solve -
by default m.s. Word by retains cropped areas of pictures so you can
un-crop them again - this can lead to picture documents of a staggering 30
meg - word has always had a built-in compression method for dealing with
this:

FormatPicturesCompressAll PicturesOK

which simply removes the cropped area perminently - problem is, this picture
compression doesn't work in Word XP , never has done

the none-coding work around is simply to cut the picture & pastespecial as
'picture' - voila - this disposes of any cropped areas (compresses the
picture) - super

i need to code this process for large documents i am developing daily, but
when i record the same process by macro, the code it produces does not do
the same thing at all - it merely pastes back the UN-cropped picture -
grrrrrrrr

i beginning to feel that the best method would be to re-install word 2000 or
word 97 - the code i have so far:

Sub CompressPictures()

Dim s As InlineShape

For Each s In ActiveDocument.InlineShapes
s.Select
Selection.Cut
Selection.PasteSpecial DataType:=wdInlineShapePicture
Next

End Sub


"Jean-Guy Marcil" NoSpam@LeaveMeAlone wrote in message
...
JethroUK© was telling us:
JethroUK© nous racontait que :

it specifies other picture types (jpegs, bitmaps,etc) - but not which
type of picture as defined by pastespecial/'picture' - i think it's
metafile


The definition is:

PasteSpecial(IconIndex, Link, Placement, DisplayAsIcon, DataType,
IconFileName, IconLabel)
The datatype is the one you want.

The problem is that the available DataTypes depend on the clipboard

content.
If the clipboard contains a picture, you can use "15" as DataType to paste

a
JPEG format. But if the clipboard contains text, this DataType will

generate
an error. The metafile format (wdPasteMetafilePicture or "3") always

works,
I think, regardless of the clipboard content. So if you cannot control

what
a user has put in the clipboard, then use that DataType. Otherwise, you

have
to check the clipboard content, then, based on the content, use a

different
DataType. If you need to go that way, let us know, code to test the
Clipboard content can be posted. But first, ask yourself if you really

need
to specify the picture type in Word....

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org




  #7   Report Post  
Jean-Guy Marcil
 
Posts: n/a
Default

JethroUK© was telling us:
JethroUK© nous racontait que :

The problem i have is really simple but i'm not finding it easy to
solve - by default m.s. Word by retains cropped areas of pictures
so you can un-crop them again - this can lead to picture documents of
a staggering 30 meg - word has always had a built-in compression
method for dealing with this:

FormatPicturesCompressAll PicturesOK

which simply removes the cropped area perminently - problem is, this
picture compression doesn't work in Word XP , never has done

the none-coding work around is simply to cut the picture &
pastespecial as 'picture' - voila - this disposes of any cropped
areas (compresses the picture) - super

i need to code this process for large documents i am developing
daily, but when i record the same process by macro, the code it
produces does not do the same thing at all - it merely pastes back
the UN-cropped picture - grrrrrrrr

i beginning to feel that the best method would be to re-install word
2000 or word 97 - the code i have so far:

Sub CompressPictures()

Dim s As InlineShape

For Each s In ActiveDocument.InlineShapes
s.Select
Selection.Cut
Selection.PasteSpecial DataType:=wdInlineShapePicture
Next

End Sub


OK, so if you know you are dealing with pictures, have you tried with "15"
as DataType? This pastes a JPEG and cuts out cropped areas.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org


  #8   Report Post  
JethroUK©
 
Posts: n/a
Default


"Jean-Guy Marcil" NoSpam@LeaveMeAlone wrote in message
...
JethroUK© was telling us:
JethroUK© nous racontait que :

The problem i have is really simple but i'm not finding it easy to
solve - by default m.s. Word by retains cropped areas of pictures
so you can un-crop them again - this can lead to picture documents of
a staggering 30 meg - word has always had a built-in compression
method for dealing with this:

FormatPicturesCompressAll PicturesOK

which simply removes the cropped area perminently - problem is, this
picture compression doesn't work in Word XP , never has done

the none-coding work around is simply to cut the picture &
pastespecial as 'picture' - voila - this disposes of any cropped
areas (compresses the picture) - super

i need to code this process for large documents i am developing
daily, but when i record the same process by macro, the code it
produces does not do the same thing at all - it merely pastes back
the UN-cropped picture - grrrrrrrr

i beginning to feel that the best method would be to re-install word
2000 or word 97 - the code i have so far:

Sub CompressPictures()

Dim s As InlineShape

For Each s In ActiveDocument.InlineShapes
s.Select
Selection.Cut
Selection.PasteSpecial DataType:=wdInlineShapePicture
Next

End Sub


OK, so if you know you are dealing with pictures, have you tried with "15"
as DataType? This pastes a JPEG and cuts out cropped areas.



i've tried jpegs and a lot of quality is lost in print (m.s help suggests
the default 'picture' type is the optimum (and it certainly is), alas it
doesn't say what type it is ) - i haven't had time to check it out yet but
i'm sure picture type 3 (wdPasteMetafilePicture
you found) will do the trick - thanks very much


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick way to paste without formatting oldstonebuddha Microsoft Word Help 2 July 22nd 05 09:33 PM
paste special - unformatted text Tom Microsoft Word Help 1 July 16th 05 07:17 PM
How is the Paste as Hyperlink feature enabled and used? Impala_68 Microsoft Word Help 1 January 16th 05 09:13 PM
paste options button no longer visible Wendy Microsoft Word Help 3 January 8th 05 10:31 AM
Very Slow Copy and Paste Growler Microsoft Word Help 0 January 3rd 05 09:35 PM


All times are GMT +1. The time now is 09:55 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"