A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Paste Special Unformatted Text in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 3rd 09, 10:06 PM posted to microsoft.public.outlook.program_vba
Gary Petersen
external usenet poster
 
Posts: 9
Default Paste Special Unformatted Text in Outlook

In Word, the macro for paste special-unformatted text is pretty simple, like
this:

Sub PasteUnformatted()
Selection.PasteSpecial Link:=False, DataType:=wdPasteText
End Sub

I'd like to do this in Outlook 2007 so I could link the VBA macro to a
button. This script gives me an object required error. Can anyone help out
with the VBA code for this? I've searched the forum here and the Internet in
general without finding a solution.

Thanks,
--
Gary Petersen

Ads
  #2  
Old March 4th 09, 02:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Paste Special Unformatted Text in Outlook

When run in Word the Selection object is known, Outlook has no idea what
you're talking about. You must fully qualify that reference, depending on
what the parent of the Selection is (Application, Pane, Global, Window,
whatever).

In Outlook the Inspector.WordEditor object (Inspectors are the windows you
use to view open Outlook items) is a Word.Document object.
Inspector.WordEditor.Parent is Word.Application. Using that knowledge you
can then get the Word document and application and use those, with the Word
object model.

The WordMail used in Outlook 2007 isn't the full Word EXE, it's a private
DLL to Outlook. So some things aren't available. What you want may or may
not be doable, given that.

There should be some information on the limitations of Word coding for
Outlook 2007 WordMail at www.outlookcode.com.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Gary Petersen" wrote in message
...
In Word, the macro for paste special-unformatted text is pretty simple,
like
this:

Sub PasteUnformatted()
Selection.PasteSpecial Link:=False, DataType:=wdPasteText
End Sub

I'd like to do this in Outlook 2007 so I could link the VBA macro to a
button. This script gives me an object required error. Can anyone help
out
with the VBA code for this? I've searched the forum here and the Internet
in
general without finding a solution.

Thanks,
--
Gary Petersen


  #3  
Old March 4th 09, 06:08 PM posted to microsoft.public.outlook.program_vba
Gary Petersen
external usenet poster
 
Posts: 9
Default Paste Special Unformatted Text in Outlook

I will check into the site you suggested, Ken. I'm not sure whether it
matters, but what I want the code to do is paste the contents of the
clipboard into the message body pane at the location where the cursor is
located as unformatted text.

Thanks,
--
Gary Petersen



"Ken Slovak - [MVP - Outlook]" wrote:

When run in Word the Selection object is known, Outlook has no idea what
you're talking about. You must fully qualify that reference, depending on
what the parent of the Selection is (Application, Pane, Global, Window,
whatever).

In Outlook the Inspector.WordEditor object (Inspectors are the windows you
use to view open Outlook items) is a Word.Document object.
Inspector.WordEditor.Parent is Word.Application. Using that knowledge you
can then get the Word document and application and use those, with the Word
object model.

The WordMail used in Outlook 2007 isn't the full Word EXE, it's a private
DLL to Outlook. So some things aren't available. What you want may or may
not be doable, given that.

There should be some information on the limitations of Word coding for
Outlook 2007 WordMail at www.outlookcode.com.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Gary Petersen" wrote in message
...
In Word, the macro for paste special-unformatted text is pretty simple,
like
this:

Sub PasteUnformatted()
Selection.PasteSpecial Link:=False, DataType:=wdPasteText
End Sub

I'd like to do this in Outlook 2007 so I could link the VBA macro to a
button. This script gives me an object required error. Can anyone help
out
with the VBA code for this? I've searched the forum here and the Internet
in
general without finding a solution.

Thanks,
--
Gary Petersen



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Special Macro ILv2Xlr8 Outlook and VBA 0 December 17th 07 02:24 PM
Unformatted Paste in Outlook 2007 Chris Boorman Outlook - General Queries 0 October 30th 07 04:27 AM
Paste Special livetohike Outlook - General Queries 0 September 15th 07 10:55 PM
paste outlook contact as text DBH Outlook - Using Contacts 2 June 24th 06 06:58 PM
Paste Text into Outlook Email gives icon not text Chad Outlook - General Queries 6 April 26th 06 09:01 PM


All times are GMT +1. The time now is 05:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.