Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA or VBS position image

Status
Not open for further replies.

GrimR

IS-IT--Management
Jun 17, 2007
1,149
ZA
Think this is VBA /VBSCRIPT question

code is from Outlook email script


How can I position this image

objShape = objSelection.InlineShapes.AddPicture (" ")
objSelection.TypeParagraph()

MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Did you try to use the 4th parameter of the AddPicture method ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hi,

Change from InlineShapes to Shapes, as InLine is, well, er, up... in line with the text and cannot be otherwised positioned.

You may need to change other properties that affect text flow.
Code:
objShape = objSelection.Shapes.AddPicture("[URL unfurl="true"]http://www./images/assets/logotagline.gif[/URL] ")

With objShape
    .Top = 10
    .Left = 20
End With

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
SkipVought
Change from InlineShapes to Shapes, as InLine is, well, er, up... in line with the text and cannot be otherwised positioned.

thanks didnt know that, no wonder I've being struggling

picture disappears when I try your method.

If i change from InlineShapes to Shapes nothing gets imported

I was thinking of something along these lines, I think the (1) I need to change to 2 as it is the second image, not sure if I'm on the right track here.
Set objShape = objSelection.InlineShapes(1).ConvertToShape


PHV (MIS)
Did you try to use the 4th parameter of the AddPicture method ?
I looked at MSDN but not sure what you mean, I must be looking in the wrong place

MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
 
I read those earlies do not see anything about justify in there.

Is it possable to justify using Inlineshape

I tried this and worked, imported and resized the image

strFilePath = " "
Set objInlineShape = objWord.Selection.InlineShapes.AddPicture(strFilePath)
objInlineShape.ScaleWidth = 200
objInlineShape.ScaleHeight = 200

Now I just need to position it

something like this

strFilePath = " "
Set objInlineShape = objWord.Selection.InlineShapes.AddPicture(strFilePath)
objInlineShape.ScaleWidth = 150
objInlineShape.ScaleHeight = 100
objInlineShape.Top = 200
objInlineShape.Left = 200

MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Please help last bit

This works so far, see end of code for what I am trying to do.

Code:
'Insert first image
objSelection.InlineShapes.AddPicture(strLogo) 
objSelection.TypeParagraph()

'Insert second image and Resize the Logo to what size you want
strFilePath = strLogo1
Set objInlineShape = objWord.Selection.InlineShapes.AddPicture(strFilePath)
objInlineShape.ScaleWidth = 65
objInlineShape.ScaleHeight = 60

'Set the indent of the logo
With objInlineShape.Range.ParagraphFormat
.LeftIndent = 30
End With

objSelection.TypeParagraph()
[b]What I need is it to stop the indent and align this next bunch of text left again[/b]



MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top