VBA - Move Shape to page within Word

SimonGeoghegan

Board Regular
Joined
Nov 5, 2013
Messages
68
Hi All,

I'm trying to find out whether its possible to move a shape to a particular page within Microsoft Word. I have code which will paste the document into the Word Document - and from there, I can adjust the position however when I change the position, it doesnt seem to change page - rather than just disappears from the original page.

The code I have is;

VBA Code:
'Paste Table into MS Word
  myDoc.Paragraphs(1).Range.PasteSpecial
    
'Assign shape
Dim Sh As Word.Shape
With myDoc
    Set Sh = .Shapes(.Shapes.Count)
End With

'Move Shape
Sh.Select

'Size Shape
Sh.LockAspectRatio = True
Sh.Width = Sh.Width * 1.5
Sh.Height = Sh.Height * 1.5

'Position Shape
Sh.Top = Sh.Top + 200
Sh.Left = Sh.Left + 25

I've had a look online but can't seem to find anything relating to moving a shape unfortunately.

Any help greatly appreciated.

Regards,
Simon
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,223,970
Messages
6,175,703
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top