Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2011, 09:06 AM
tinfanide tinfanide is offline Excel VBA: Control Word Table and Set its properties Windows 7 64bit Excel VBA: Control Word Table and Set its properties Office 2010 32bit
Expert
Excel VBA: Control Word Table and Set its properties
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Excel VBA: Control Word Table and Set its properties

Code:
Sub testing()

Dim wrdApp As Word.Application
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Dim wrdDoc As Word.Document
Set wrdDoc = wrdApp.Documents.Add

Dim tbl As Word.Table
Set tbl = wrdDoc.Tables.Add(Range:=wrdDoc.Range, NumRows:=6, NumColumns:=1)

With tbl
    .Borders(wdBorderTop).LineStyle = wdLineStyleSingle
    .Borders(wdBorderRight).LineStyle = wdLineStyleSingle
    .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
    .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
    .Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle
    .Borders(wdBorderVertical).LineStyle = wdLineStyleSingle
    
For r = 1 To 6
    .Cell(r, 1).Range.Text = ActiveSheet.Cells(r, 1).Value
Next r

For s = 1 To 6 Step 2

    .Cell(s, 1).Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
    ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1).StartAt
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' don't know how to set the properties
Next s
End With

End Sub
Can anyone give some hints? I can hardly find any tutorials to learn from online.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA: Control Word Table and Set its properties Excel table properties pmblom Excel 4 07-03-2011 02:00 AM
Excel VBA: Control Word Table and Set its properties Excel data to Word table Jaymond Flurrie Word VBA 2 02-27-2011 07:42 PM
Excel VBA: Control Word Table and Set its properties is there file 'version' control in excel keithg Excel 1 11-14-2010 07:51 AM
Control cell width and wrapping in table. gcowan Word Tables 0 07-07-2010 11:28 AM
Control how Excel Opens slew0302 Office 0 02-03-2009 01:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:57 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