Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2011, 07:35 AM
gsj224 gsj224 is offline Create Table Form from Word Document Windows 7 64bit Create Table Form from Word Document Office 2010 64bit
Novice
Create Table Form from Word Document
 
Join Date: Jul 2011
Posts: 1
gsj224 is on a distinguished road
Default Create Table Form from Word Document

Hello,



I have a document that contains several questions that I would to transpose into a table i.e. COPY all data before a carriage return (but after the previous carriage return and PASTE it into the proposed table. I'd like to repeat that as many times as needed.

Is this possible?

To add further clarity if I had the following on my word document:

What is your name
When were you born
Where were you born

I would like to end up with a table which has 2 columns and 3 rows and have the questions appear in the left most column with the right most column being blank.

Thank you so much to anyone who can help or at least point me in the right direction. Furthermore, I'd like this to be initiated on the word doc by a click of a button.
Reply With Quote
  #2  
Old 07-29-2011, 01:09 PM
Kimberly Kimberly is offline Create Table Form from Word Document Windows 7 64bit Create Table Form from Word Document Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

Select the paragraphs of text
Replace paragraph marks with Paragraph mark tab character
With the paragraphs of text still selected, on the Insert tab, click Table then Convert text to table. OK

Last edited by Kimberly; 07-29-2011 at 01:11 PM. Reason: typo
Reply With Quote
  #3  
Old 07-29-2011, 03:41 PM
Kimberly Kimberly is offline Create Table Form from Word Document Windows 7 64bit Create Table Form from Word Document Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

LOL, I didn't see this part:

Quote:
Furthermore, I'd like this to be initiated on the word doc by a click of a button.
That's quite an 'oh by the way'.

Turn on the macro recorder after you select the paragraphs of questions.
Reply With Quote
  #4  
Old 07-31-2011, 09:26 AM
gmaxey gmaxey is offline Create Table Form from Word Document Windows XP Create Table Form from Word Document Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Select all of the text include the last paragraph mark and run this macro:
Code:
Sub ScratchMacro()
'A quick macro scratch pad created by Greg Maxey
Dim i As Long, j As Long
Dim arrData() As String
Dim oRng As Word.Range
Dim oTbl As Word.Table
Set oRng = Selection.Range
ReDim arrData(oRng.Paragraphs.Count - 1)
For i = 0 To UBound(arrData)
  arrData(i) = Left(oRng.Paragraphs(i + 1).Range.Text, Len(oRng.Paragraphs(i + 1).Range.Text) - 1)
Next i
oRng.Delete
Set oTbl = ActiveDocument.Tables.Add(oRng, UBound(arrData) + 1, 2)
For i = 0 To UBound(arrData)
  oTbl.Cell(i + 1, 1).Range.Text = arrData(i)
Next i
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Table Form from Word Document How do I create an index of every word in a document? jbengal Word 5 11-23-2022 02:17 PM
Create Table Form from Word Document Put a document in word into a fillable form groovy chick Word 3 01-18-2012 04:49 AM
How can create a form in Word 2007 that can be automatically filled? artistech Word 0 08-04-2010 01:05 PM
how to create a word document to be printed on a letterpad damad Word 0 07-23-2009 12:11 AM
How to add Table of Content in word document by C# ! ! ! arun singh Word 0 11-12-2008 11:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:00 AM.


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