|
-
September 22nd, 1999, 01:00 PM
#1
Modifying Word Documentsin from VB Code
I have a Table in a word document
I want to insert an image in one of the cells of the table
How can i do this?
I wrote some code
But this dosnot serve the correct purpose.
The image is inserted in the document but not in the table
Here is my code
Sub UpdateDoc()
Dim myDoc as Document
'THere is a single table in this document
set myDoc = GetObject("d:\vbTest.doc")
'I want to put a picture inside the third column ,first row
'in the only table in the document
'get the picture in clipboard
Clipboard.Clear
Clipboard.SetData LoadPicture("c:\windows\Bubbles.bmp")
'Select the Cell(1,3)
myDoc.Tables(1).Cell(1, 3).Select
'The image is put in the document
'But not in the table before the table
myDoc.Application.Selection.Paste
myDoc.Save
myDoc.Close
Clipboard.Clear
End Sub
Thanx and Regards
Vijay
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|