|
-
Feb 9th, 2006, 01:58 PM
#1
Thread Starter
Junior Member
[RESOLVED] how can I add a Picture into table? (WORD)
hi, all!
I have:
VB Code:
'I've got it from a recorded macro. It works:
Selection.InlineShapes.AddPicture FileName:= _
"C:\MyPicture.jpg", LinkToFile:=False, SaveWithDocument :=True
'AND REFERENCE TO MY TableSTRING:
Set String1 = Table1.Rows.Add
But how can I add Picture into string without "Selection."
I've tried:
String1.Cells(2).Range.AddPicture...
& String1.Cells(2).Range.InlineShapes.AddPicture...
it doesn't work
Help me please!
kind regards,
Baloo.
Last edited by Baloo; Feb 9th, 2006 at 02:28 PM.
-
Feb 10th, 2006, 06:43 AM
#2
Re: how can I add a Picture into table? (WORD)
Here is the problem:
Set String1 = Table1.Rows.Add
Here you need to mention which table you are going to work. It may be the table where the cursor located or may be the table no. in the active document. So, it popups the error.
Here is the code for you.
VB Code:
Dim String1 As Range
'table where the cursor located
Set String1 = Selection.Tables(1).Range
'the 1st table of the current document
'Set String1 = ActiveDocument.Tables(1).Range
String1.Tables(1).Cell(1, 2).Range.InlineShapes.AddPicture filename:= _
"C:\Clip.gif", LinkToFile:=False, SaveWithDocument:=True
'String1.Tables(1).Cell(1, 2).Range.InlineShapes.AddPicture filename:= _
"C:\Clip.gif", LinkToFile:=False, SaveWithDocument:=True
Last edited by cssriraman; Feb 10th, 2006 at 06:46 AM.
CS
-
Feb 12th, 2006, 10:58 AM
#3
Thread Starter
Junior Member
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
|