Selcting a picture as part of a range

B

Ben

I have some VB code that selects a range, that cuts and
pastes the range and send an email with the content.

The problem is....I cannot not get the company logo (bmp)
to be selected as part of the range.

Any help on how to do this would be greatly appreaciated.

Thanks,
Ben
 
B

Ben

Thanks...The VB code works fine... The email is
automatically generated and works well.

Selecting the logo (picture) as part of the range is the
problem.

-----Original Message-----
Hi Ben

http://www.rondebruin.nl/sendmail.htm#body
I have some code on my site to do this with 2000 but without pictures.

But you can also send the range in a new workbook
http://www.rondebruin.nl/sendmail.htm#selection



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ben" <[email protected]> wrote in
message news:[email protected]...
 
R

Ron de Bruin

Hi Ben

If you want it in the body you can make a picture of the whole range and send that.
Do you want that?
 
R

Ron de Bruin

Try this code from ???

Attach this file to the mail
C:\range.gif


Sub Testing()
Application.ScreenUpdating = False
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture

Set ctoTheChartHolder = ActiveSheet.ChartObjects.Add(0, 0, 800, 600)

Set chtTheChart = ctoTheChartHolder.Chart

' Paste the picture onto the chart and
' set an object variable for it
ctoTheChartHolder.Activate
With chtTheChart
.ChartArea.Select
.Paste
Set picThePicture = .Pictures(1)
End With

' Set the picture's properties...
With picThePicture
.Left = 0
.Top = 0
sglWidth = .Width + 7
sglHeight = .Height + 7
End With

' Change the size of the chart object to fit the picture
'better
With ctoTheChartHolder
.Border.LineStyle = xlNone
.Width = sglWidth
.Height = sglHeight
End With

' Which filter to use?..
strFileExtension = "bmp"

' Export the chart as a graphics file
blnRet = chtTheChart.Export(Filename:="c:\range.gif", _
Filtername:="gif", Interactive:=False)
ctoTheChartHolder.Delete

Application.ScreenUpdating = True
End Sub
 
B

Ben

Thanks for the help...will try it.

-----Original Message-----
Try this code from ???

Attach this file to the mail
C:\range.gif


Sub Testing()
Application.ScreenUpdating = False
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture

Set ctoTheChartHolder = ActiveSheet.ChartObjects.Add (0, 0, 800, 600)

Set chtTheChart = ctoTheChartHolder.Chart

' Paste the picture onto the chart and
' set an object variable for it
ctoTheChartHolder.Activate
With chtTheChart
.ChartArea.Select
.Paste
Set picThePicture = .Pictures(1)
End With

' Set the picture's properties...
With picThePicture
.Left = 0
.Top = 0
sglWidth = .Width + 7
sglHeight = .Height + 7
End With

' Change the size of the chart object to fit the picture
'better
With ctoTheChartHolder
.Border.LineStyle = xlNone
.Width = sglWidth
.Height = sglHeight
End With

' Which filter to use?..
strFileExtension = "bmp"

' Export the chart as a graphics file
blnRet = chtTheChart.Export (Filename:="c:\range.gif", _
Filtername:="gif", Interactive:=False)
ctoTheChartHolder.Delete

Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ben" <[email protected]> wrote in
message news:[email protected]...
 
Top