VBA copy to clipboard

  • Thread starter Victor and TJ Friedmann
  • Start date
V

Victor and TJ Friedmann

I have tried several macros designed to copy all text from a current slide
and place it into the clipboard. Nothing works. Help.

Any ideas out there.

Thanks,

Vic
 
D

David Marcovitz

I have tried several macros designed to copy all text from a current slide
and place it into the clipboard. Nothing works. Help.

Any ideas out there.

Thanks,

Vic
It would be easier to help you if you posted some code that you tried so we
could pick it apart and possibly adjust it. Also, be sure to specify what
version of PowerPoint you are using. Finally, when you say "Nothing works,"
can you be more specific. I can think of several things that could fail,
including that you don't get anything copied at all, you get something
copied but it won't paste outside of PowerPoint, you get some text copied
but not all, you get all the text copied but not what is in the notes area,
you get the text copied and it pastes without formatting, etc.
--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
V

Victor and TJ Friedmann

Thanks, David

Here is one code I tried.

Sub servings()

ActiveWindow.Selection.SlideRange.Shapes.TextFrame.TextRange
ActiveWindow.Selection.Copy






End Sub

My object is to copy all text from the active window onto the clipboard so
that I can paste it later onto Notepad.

Thanks

Vic
 
D

David Marcovitz

That's weird. The first line is just a pointer to the selected text area of
the current text box, but it doesn't do anything. The second line will copy
whatever is selected, but that might be a shape and not text. So this should
not work. In fact I don't think it will get past the first line because it
is an incomplete statement (it's kind of like a phrase without a verb). It's
also not quite right. You might try something like:

ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Copy


Your original post said that you wanted to copy all the text from a slide.
This code looks like you are trying to copy the text from a single selected
text box. That is what my line of code does. So, once again, you need to
have a shape that has text selected and then run the macro.

If you really want all the text on a slide, it is a bit more complicated
because you have to loop through all the shapes on the slide, check each
shape to see if it has a TextFrame and then add the text to a something,
which you will then have to copy.

--David

Thanks, David

Here is one code I tried.

Sub servings()

ActiveWindow.Selection.SlideRange.Shapes.TextFrame.TextRange
ActiveWindow.Selection.Copy






End Sub

My object is to copy all text from the active window onto the clipboard so
that I can paste it later onto Notepad.

Thanks

Vic

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
V

Victor and TJ Friedmann

David,

Thanks for your comments. I see now that what I want to do inolves more
coding than I expected. I'll look for another way to do what I want. My more
corrent posting on this objective explains what I need, but the coding may
be beyond my capability.

Vic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top