LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.vba.general,microsoft.public.excel.charting
external usenet poster
 
Posts: 46
Default Pasting charts to Word from Excel as picture

Hi,

I want to transfer some charts (as picture) in excel to a particular
word document (specific page and specific position). The word document
already has some data and lots of pages in it and Im inserting charts
in specific places.

When I used to do the above task for Excel to Power- point then I could
use the, Right click Format picture, of Size (Height, Width) and
Position on Slide (Horizontal, Vertical) in order to place the charts
in powerpoint in the exact position and dimension I want.

But Im not able to see an analogous feature in word where I could
specify the Position (Position on page - Horizontal and Vertical) of
object/chart in Word. When I do right click on a picture in Word, then
size tab has height and width (Good for me), but I dont have any tab
for position. What we do have is a tab called Layout, in which the
"Advanced" button has Absolute position ... to of the column and
Absolute position .... below paragraph. Im not sure whether by using
these 2 properties I will be able to position my chart in the place I
want.

Again, I have not been able to try the above because of 2 reasons:-

a) If I copy paste a chart named as Chart1 in excel to Winword then
what is the name of that object in word? For checking this I recorded a
macro in word where I selected a newly pasted chart from excel and see
that the code it produces is

ActiveDocument.Shapes("Group 1570").Select

Knowin the name of the chart in word seemed important to me, because as
soon as im done pasting, the cursor in word moves to the new line or
rather the chart object is no longer active in word. So, if it is not
active then how do I apply positional and size properties to it?

b) Secondly, Im not sure of the of the exact syntax for applying
positional and size properties. When I record a macro in word where I
change the Height/width/Abs Position Col/ Abs Position Para to 2 inches
then I get lot of recorded code out of which following seemed relevant
to me (I have snipped rest).

Selection.ShapeRange.Height = 144#
Selection.ShapeRange.Width = 144#
Selection.ShapeRange.Left = 180#
Selection.ShapeRange.Top = 126#
Selection.ShapeRange.Left = InchesToPoints(2)
Selection.ShapeRange.Top = InchesToPoints(2)

Im not able to understand as to why the Left and Top (Probably the
positonal parameters for object) is getting recorded twice and that too
in different units (once as 180# and another time as
InchesToPoints(2)).

Also, I want to know one more thing. As I have already mentioned I have
text data in word and I have left enough space so that when a new chart
gets pasted the text data below the chart doesnt get shifted down. For
example, in the below code Im first navigating to the page where I want
to paste chart and then pasting it. In this whats happening is that,
even my page title and rest text gets shifted. How to avoid this
situation

Sub StartTransferProcess(WkbookNam As String, ShtNam As String, ChtNam
As String, _
Pageno As Byte, Height As Double, Width As Double, ColPos As Double,
ParPos As Double)

Set SWinword = GetObject(, "Word.application")
Set Sdocument = SWinword.Documents(WordDocName)

Workbooks(WkbookNam & ".xls").Activate
Sheets(ShtNam).Select
ActiveSheet.ChartObjects(ChtNam).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

Sdocument.Activate
Sdocument.ActiveWindow.Selection.GoTo What:=wdGoToPage,
Which:=wdGoToNext, Name:=Pageno
Sdocument.ActiveWindow.Selection.Paste

''' New code to be written for Positioning and sizing object

End Sub

Regards,
HP
India

 
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
Extract MS Excel Data embedded in MS Word qualityprocess Excel Discussion (Misc queries) 0 April 20th 06 05:52 PM
Putting Excel Charts into a Word document that's getting too big Jennifer Charts and Charting in Excel 2 March 10th 06 01:36 AM
Problem with excel charts pasted into Word laudrup Excel Discussion (Misc queries) 2 March 9th 06 12:08 AM
Excel startup switches Randy Excel Discussion (Misc queries) 9 June 14th 05 10:27 PM
exporting excel worksheet to word morrowkd Links and Linking in Excel 1 May 11th 05 11:23 PM


All times are GMT +1. The time now is 02:24 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"