Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a table in Word

I know this is a long shot but is there anybody out there who knows ho
to create a two column table in Word from Excel and then add data int
it..

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Creating a table in Word

This will point you in the right direction, I recorded this macro in word
into "Normal.NewMacros" in the Vb editor. Then with the TestIt macro I call
the word macro from excel. In this case word is already open.


Sub InsertTable() 'Word Macro
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3,
NumColumns:= _
2, DefaultTableBehavior:=wdWord9TableBehavior,
AutoFitBehavior:=wdAutoFitFixed
With Selection.Tables(1)
If .Style < "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With

End Sub




Sub TestIt() 'Excel Macro
Set WdApp = Word.Application 'used to say "New Word.Application" when
word wasn't open
With WdApp
'.Documents.Open Filename:="C:\Macro Laden Document.doc" 'if you want to
open a document
'.Visible = True
'.WindowState = xlMaximized
'.Activate
.Application.Run MacroName:="Normal.NewMacros.InsertTable"
End With 'WdApp

Set WdApp = Nothing
End Sub


--
Regards,
Rocky McKinley


"tonesmcbutt " wrote in message
...
I know this is a long shot but is there anybody out there who knows how
to create a two column table in Word from Excel and then add data into
it...


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a table in Word

Thank you for replying - I will give it a try and let you know how I got
on


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko[_2_] Excel Discussion (Misc queries) 1 May 5th 10 08:22 AM
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko Excel Discussion (Misc queries) 0 May 5th 10 12:21 AM
creating a report from a table, pivot table not suitable UKMAN Excel Worksheet Functions 1 April 16th 10 08:35 AM
Link table from excel to word using word VBA [email protected] Excel Discussion (Misc queries) 7 January 9th 07 05:57 PM
Creating a Hyperlink from a Single Word Kara Links and Linking in Excel 1 July 1st 06 12:40 PM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"