Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-16-2011, 10:57 PM
Jaymond Flurrie Jaymond Flurrie is offline Before the table but after beginning of doc? Windows 7 64bit Before the table but after beginning of doc? Office 2010 32bit
Novice
Before the table but after beginning of doc?
 
Join Date: Feb 2011
Posts: 13
Jaymond Flurrie is on a distinguished road
Default Before the table but after beginning of doc?

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Before the table but after beginning of doc? Powerpoint loops, but not to beginning imeister PowerPoint 1 02-02-2011 02:05 PM
Before the table but after beginning of doc? keep only sentences beginning with: Wind 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
Before the table but after beginning of doc? Add text to the beginning/ending of each line in word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft