PC Review


Reply
Thread Tools Rate Thread

Accessing pasted pictures

 
 
=?Utf-8?B?QWJoaW1hbnl1IFNpcm9oaQ==?=
Guest
Posts: n/a
 
      12th Oct 2006
I am creating a Shared Add-In in Visual Studio 2005 using Interop assemblies
for Office XP. (v10).
I want to put pictures in cells, so I copied them to the clipboard and
pasted on a range (single cell). Now, Is there anyway I can access these
pasted pictures. Excel names them "Picture 1", "Picture 2" and so on. Even if
I rename "Picture 1", the newly pasted picture is "Picture 2".
Also, Is there a way to avoid copying to the clipboard and then pasting the
picture. Any direct method to insert a picture in worksheet (I have an Image
object not a filename, so Shapes.AddPicture won;t work).

regards

 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      12th Oct 2006
The pictures will be members of the shapes collection, so you could
access them that way.
Somethign like:

Sub mypics()
Dim myObj As Object

For Each myObj In ActiveSheet.Shapes
If myObj.Type = msoPicture Then
MsgBox myObj.Name
End If
Next myObj
End Sub



Abhimanyu Sirohi wrote:
> I am creating a Shared Add-In in Visual Studio 2005 using Interop assemblies
> for Office XP. (v10).
> I want to put pictures in cells, so I copied them to the clipboard and
> pasted on a range (single cell). Now, Is there anyway I can access these
> pasted pictures. Excel names them "Picture 1", "Picture 2" and so on. Even if
> I rename "Picture 1", the newly pasted picture is "Picture 2".
> Also, Is there a way to avoid copying to the clipboard and then pasting the
> picture. Any direct method to insert a picture in worksheet (I have an Image
> object not a filename, so Shapes.AddPicture won;t work).
>
> regards


 
Reply With Quote
 
=?Utf-8?B?QWJoaW1hbnl1IFNpcm9oaQ==?=
Guest
Posts: n/a
 
      13th Oct 2006
Hi,
But how do I get the name of picture I've just pasted. This iteration will
return all the pictures. I need the one I've pasted right now.

thanks


"John" wrote:

> The pictures will be members of the shapes collection, so you could
> access them that way.
> Somethign like:
>
> Sub mypics()
> Dim myObj As Object
>
> For Each myObj In ActiveSheet.Shapes
> If myObj.Type = msoPicture Then
> MsgBox myObj.Name
> End If
> Next myObj
> End Sub
>
>
>
> Abhimanyu Sirohi wrote:
> > I am creating a Shared Add-In in Visual Studio 2005 using Interop assemblies
> > for Office XP. (v10).
> > I want to put pictures in cells, so I copied them to the clipboard and
> > pasted on a range (single cell). Now, Is there anyway I can access these
> > pasted pictures. Excel names them "Picture 1", "Picture 2" and so on. Even if
> > I rename "Picture 1", the newly pasted picture is "Picture 2".
> > Also, Is there a way to avoid copying to the clipboard and then pasting the
> > picture. Any direct method to insert a picture in worksheet (I have an Image
> > object not a filename, so Shapes.AddPicture won;t work).
> >
> > regards

>
>

 
Reply With Quote
 
=?Utf-8?B?QWJoaW1hbnl1IFNpcm9oaQ==?=
Guest
Posts: n/a
 
      13th Oct 2006
Hi,
But how do I get the name of picture I've just pasted. This iteration will
return all the pictures. I need the one I've pasted right now.

thanks


"John" wrote:

> The pictures will be members of the shapes collection, so you could
> access them that way.
> Somethign like:
>
> Sub mypics()
> Dim myObj As Object
>
> For Each myObj In ActiveSheet.Shapes
> If myObj.Type = msoPicture Then
> MsgBox myObj.Name
> End If
> Next myObj
> End Sub
>
>
>
> Abhimanyu Sirohi wrote:
> > I am creating a Shared Add-In in Visual Studio 2005 using Interop assemblies
> > for Office XP. (v10).
> > I want to put pictures in cells, so I copied them to the clipboard and
> > pasted on a range (single cell). Now, Is there anyway I can access these
> > pasted pictures. Excel names them "Picture 1", "Picture 2" and so on. Even if
> > I rename "Picture 1", the newly pasted picture is "Picture 2".
> > Also, Is there a way to avoid copying to the clipboard and then pasting the
> > picture. Any direct method to insert a picture in worksheet (I have an Image
> > object not a filename, so Shapes.AddPicture won;t work).
> >
> > regards

>
>

 
Reply With Quote
 
=?Utf-8?B?QWJoaW1hbnl1IFNpcm9oaQ==?=
Guest
Posts: n/a
 
      13th Oct 2006
Hi,
But how do I get the name of picture I've just pasted. This iteration will
return all the pictures. I need the one I've pasted right now.

thanks


"John" wrote:

> The pictures will be members of the shapes collection, so you could
> access them that way.
> Somethign like:
>
> Sub mypics()
> Dim myObj As Object
>
> For Each myObj In ActiveSheet.Shapes
> If myObj.Type = msoPicture Then
> MsgBox myObj.Name
> End If
> Next myObj
> End Sub
>
>
>
> Abhimanyu Sirohi wrote:
> > I am creating a Shared Add-In in Visual Studio 2005 using Interop assemblies
> > for Office XP. (v10).
> > I want to put pictures in cells, so I copied them to the clipboard and
> > pasted on a range (single cell). Now, Is there anyway I can access these
> > pasted pictures. Excel names them "Picture 1", "Picture 2" and so on. Even if
> > I rename "Picture 1", the newly pasted picture is "Picture 2".
> > Also, Is there a way to avoid copying to the clipboard and then pasting the
> > picture. Any direct method to insert a picture in worksheet (I have an Image
> > object not a filename, so Shapes.AddPicture won;t work).
> >
> > regards

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pasted pictures not same size RR Microsoft Word Document Management 3 19th May 2009 11:48 PM
Page Breaks and Pasted Pictures DerbyDad03 Microsoft Word Document Management 2 27th Aug 2007 04:41 PM
How do i see pictures pasted on my word document =?Utf-8?B?UGFydWw=?= Microsoft Word New Users 0 5th Jun 2006 11:48 AM
Excel 2007 Beta Pasted Pictures All Turn Into Last Pasted Picture =?Utf-8?B?R2VyZW1pYSBEb2Fu?= Microsoft Excel Crashes 5 31st May 2006 12:01 AM
pasted pictures wont appear =?Utf-8?B?ZGFuZXQ0?= Microsoft Word Document Management 1 21st Nov 2004 07:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 PM.