creating a word table via vba

G

Guest

Does anyone know how to create a word table within some vba code within a
document I've created via automation (late binding)? here is a snippet of my
code...
*********** indicates where i want to create the table and insert some data
from my access db.

If Records = 1 Then
If sFUND_NAME <> sNEXT_FUND_NAME Then
With .Selection

.ParagraphFormat.Alignment =
wdAlignParagraphCenter
.InlineShapes.AddPicture
FileName:="W:\Stewardship_Automation\New Picture.png", LinkToFile:=False, _
SaveWithDocument:=True
.TypeParagraph
.TypeParagraph
.Font.Size = 18
.ParagraphFormat.Alignment = 0
.Font.Bold = True
.Font.Italic = True
.TypeText Text:=sFUND_NAME
.TypeParagraph
.TypeParagraph
.TypeParagraph
.Font.Size = 14
.Font.Bold = True
.ParagraphFormat.Alignment =
wdAlignParagraphLeft
.TypeText Text:="2006-2007 RECIPIENT
INFORMATION"
.TypeParagraph
**************************************
.Font.Size = 14
.Font.Bold = True
.TypeParagraph
.TypeText Text:=sName & vbTab & cAmount &
vbTab & sPCITY & vbTab & sPSTATE & vbTab & sCLASS & vbTab & sMajor
.TypeParagraph
.TypeParagraph
.InsertBreak Type:=wdPageBreak
End With
'.ActiveDocument.SaveAs FileName:=SaveAsName

Else

TIA!
 
G

Guest

Fist off a little tip for future development.

1. Start Word
2. Record a macro (Tools - Macro - Record New Macro)
3. Do all the steps 'by hand'
4. Stop Record Macro.
5. Look at the code created (Alt-F11) then use it as a building block to
create your code from.

Now for the solution to your question take a look at
http://groups.google.ca/group/micro...create+a+table&rnum=10&hl=en#052660dfc14bd84e

http://groups.google.ca/group/micro...create+a+table&rnum=20&hl=en#2864f459abca0366

http://groups.google.ca/group/micro...create+a+table&rnum=47&hl=en#29e99d543863e7be
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top