![]() |
#1
|
|||
|
|||
![]()
This is most likely extremely simple for you who are experienced Word VBA users:
I print a Word document from Excel VBA (with print I mean I have data in Excel and print that into the Word document), the result being one table in Word. Now at the beginning of this print I don't know the amount of rows this table has, but when the code is finished, I'd like to enter a couple of empty rows on top of the table ie. shifting the table down a bit and write there above the table something like "My table: 30 lines". Now when I have tried this, it prints the text to the first cell. How do I point a bit earlier spot than that, to beginning of the document instead of that table? The code I have tried this shift&print with is: Code:
Sub InsertBeforeMethod() Dim MyText As String Dim MyRange As Object Set MyRange = ActiveDocument.Range MyText = "Test" MyRange.InsertBefore (MyText) End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
imeister | PowerPoint | 1 | 02-02-2011 02:05 PM |
![]() |
Michael007 | Word VBA | 3 | 01-17-2011 04:11 PM |
Dash in the beginning of a new line | Wakinyan | Word | 0 | 07-11-2010 07:10 AM |
![]() |
ballmoney | Word | 1 | 01-17-2010 02:19 AM |
Looping macros to add text to beginning and end of a paragraph | pachmarhi | Word VBA | 0 | 02-16-2009 06:57 AM |