Need way to change document spacing thru vba in word doc

HunterN

Active Member
Joined
Mar 19, 2002
Messages
479
Hi,

I have an application that (through VBA) opens an existing excel workbook and puts it into a Word document. This works just fine. But, since I have just recently converted to Office 2007 I find that the line spacing in 2007 is bigger than previous Word. I recorded a macro inside Word 2007 to make the spacing 1 line. This is what the recorder showed:

WordBasic.OpenOrCloseParaBelow

I stuck this inside the current macro I have that creates the Word document from Excel, but nothing happened. It didn't give an error and it didn't change the spacing. I think it is because I did not have anything selected inside the document. This is actually a table inside Word. How do I select the document (table) through VBA in order for this spacing command to work?

Thanks for any examples.

Nancy
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
OK - here is the two lines that I needed.

wrdApp.Selection.WholeStory
WordBasic.OpenOrCloseParaBelow

Hope this helps someone else.

: )
 
Upvote 0

Forum statistics

Threads
1,221,574
Messages
6,160,601
Members
451,657
Latest member
Ang24

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