Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Pasting Charts into Word then resizing them

Hi

I've got a bit of code that copys some charts from excel into Word as
an enhanced metafile, however once in word i need to resize (reduce)
the charts. I have the code to do both of these things (see below),
however, the problem i am having is actually selecting the newly
pasted in chart so that it can be resized.

Any suggestions of how to go about this?

Thanks
Paul


Dim WordObj As Object

Set WordObj = CreateObject("Word.application")
With WordObj
.Visible = True
.Documents.Open "c:\paper\" & Title & ".doc"
End With

ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, _
Format:=xlPicture

WordObj.Selection.Goto What:=wdGoToBookmark, Name:="Bkm1"
WordObj.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdFloatOverText, DisplayAsIcon:=False

''######## this is where i need to select the new image
###########################

WordObj.Selection.ShapeRange.ScaleWidth 0.53, msoFalse,
msoScaleFromTopLeft
WordObj.Selection.ShapeRange.ScaleHeight 0.53, msoFalse,
msoScaleFromTopLeft

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Pasting Charts into Word then resizing them

1. In general you get better results if you completely format (i.e., size)
the charts in Excel before copying and pasting.

2. In general macros run better if you don't select things before editing
them. Try referencing by
WordObj.ActiveDocument.InlineShapes(WordObj.Active Document.InlineShapes.Count)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
ups.com...
Hi

I've got a bit of code that copys some charts from excel into Word as
an enhanced metafile, however once in word i need to resize (reduce)
the charts. I have the code to do both of these things (see below),
however, the problem i am having is actually selecting the newly
pasted in chart so that it can be resized.

Any suggestions of how to go about this?

Thanks
Paul


Dim WordObj As Object

Set WordObj = CreateObject("Word.application")
With WordObj
.Visible = True
.Documents.Open "c:\paper\" & Title & ".doc"
End With

ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, _
Format:=xlPicture

WordObj.Selection.Goto What:=wdGoToBookmark, Name:="Bkm1"
WordObj.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdFloatOverText, DisplayAsIcon:=False

''######## this is where i need to select the new image
###########################

WordObj.Selection.ShapeRange.ScaleWidth 0.53, msoFalse,
msoScaleFromTopLeft
WordObj.Selection.ShapeRange.ScaleHeight 0.53, msoFalse,
msoScaleFromTopLeft



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing many charts Hosley Charts and Charting in Excel 5 November 21st 06 08:39 AM
Pasting charts to Word from Excel as picture Hari Charts and Charting in Excel 5 July 5th 06 08:04 PM
Resizing Charts Andy Excel Discussion (Misc queries) 1 June 21st 06 08:05 PM
Pasting Excel charts into Word Theresa Charts and Charting in Excel 4 January 27th 06 03:36 AM
unwanted resizing when copy-pasting embedded charts holg3r Charts and Charting in Excel 4 June 4th 05 03:28 AM


All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"