By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

How to Add Table in a MS Word Document from VB6 Application

P: 68
Hi,
How can I add Table in a MS Word Document from VB6 Application, Please Help me.

Regards,
A K SHuvo
Jan 16 '08 #1
Share this Question
Share on Google+
1 Reply


kadghar
Expert 100+
P: 1,295
Hi,
How can I add Table in a MS Word Document from VB6 Application, Please Help me.

Regards,
A K SHuvo
create an object with a word application and use the code for it (if you dont know it, record a macro in word, copy it, paste it and add the name of the object where needed).
Expand|Select|Wrap|Line Numbers
  1. Dim obj1 As Object
  2. Set obj1 = CreateObject("word.application")
  3. obj1.documents.Open ("c:\myDocument.doc")
  4. obj1.Visible = True
  5. obj1.activedocument.tables.Add Range:=obj1.Selection.Range, numrows:=3, numcolumns:=3
You can set or not the visible property, i wrote it so you can see what the code does.
Jan 16 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.