I have some excel vba that produces different types of reports from a form. One of the options is to export the data to word. In order to do this I copy the part of the spreadsheet and paste it into word using the following code:
Set wordobj = CreateObject("Word.Application")
With wordobj
...
Worksheets("chartdata").Select
Worksheets("chartdata").Range("A1:G19").Select
Selection.Copy
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
.typeparagraph
.typeparagraph
.ParagraphFormat.Alignment = 0
.Paste
the problem is that the table spills over the right hand side of the page. I need to move the table to the left slightly so that all the cells fit on the page. Is there any way to either change the word page indents or select the table and move it?
Cheers
Set wordobj = CreateObject("Word.Application")
With wordobj
...
Worksheets("chartdata").Select
Worksheets("chartdata").Range("A1:G19").Select
Selection.Copy
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
.typeparagraph
.typeparagraph
.ParagraphFormat.Alignment = 0
.Paste
the problem is that the table spills over the right hand side of the page. I need to move the table to the left slightly so that all the cells fit on the page. Is there any way to either change the word page indents or select the table and move it?
Cheers