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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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