In developing an application for Word which sends e-mail messages using
Outlook, I came across an issue that I have not been able to resolve.
Hopefully someone will have a plan :)
With Outlook's options configured to spell check the message before sending,
each message processed creates the message 'Word finished checking the
selection. Do you want to continue the remainder of the document' which
requires user intervention. Clearly if the option is switched off in
Outlook, the message doesn't occur. As I have no control over whether users
have this option set or not, I would like to switch off the spell checkling
for the duration of the process and thus avoid the need for user
interaction.
Solutions posted on the web all seem to revolve around setting the registry
entry associated with the option - along the lines of
Dim myWS As Object
Dim RegKey As String
Dim Key As String
Dim Ver As Variant
Ver = Application.version
Key = "HKEY_CURRENT_USER\Software\Microsoft\Office\" _
& Ver & "\Outlook\Options\Spelling\Check"
Set myWS = CreateObject("WScript.Shell")
'Read key from registry
RegKey = myWS.RegRead(Key)
'Write new value
myWS.Regwrite Key, 0
'send message
'Write back original value
myWS.Regwrite Key, RegKey
While this certainly changes the registry, it has no effect on the problem
unless Outlook is closed and restarted.
Does anyone know of a way to suppress this message from vba that does not
involve restarting Outlook?
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/13/2010 2:04:59 PM |
|
Unfortunately that's just one of a bunch of settings that are read on
startup and then maintained in memory. So the registry settings are only
read on startup.
About the only thing I can think of would be a real hack involving Win32 API
stuff to send a WM_CLOSE message to that dialog when it opens, monitoring
for it opening. Depending on version and whether or not WordMail was used
there'd probably be different classes for the dialog, that would take some
work with Spy++.
--
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
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:OIyg8VLrKHA.3792@TK2MSFTNGP05.phx.gbl...
> In developing an application for Word which sends e-mail messages using
> Outlook, I came across an issue that I have not been able to resolve.
> Hopefully someone will have a plan :)
>
> With Outlook's options configured to spell check the message before
> sending, each message processed creates the message 'Word finished
> checking the selection. Do you want to continue the remainder of the
> document' which requires user intervention. Clearly if the option is
> switched off in Outlook, the message doesn't occur. As I have no control
> over whether users have this option set or not, I would like to switch off
> the spell checkling for the duration of the process and thus avoid the
> need for user interaction.
>
> Solutions posted on the web all seem to revolve around setting the
> registry entry associated with the option - along the lines of
>
> Dim myWS As Object
>
> Dim RegKey As String
>
> Dim Key As String
>
> Dim Ver As Variant
>
> Ver = Application.version
>
> Key = "HKEY_CURRENT_USER\Software\Microsoft\Office\" _
>
> & Ver & "\Outlook\Options\Spelling\Check"
>
> Set myWS = CreateObject("WScript.Shell")
>
> 'Read key from registry
>
> RegKey = myWS.RegRead(Key)
>
> 'Write new value
>
> myWS.Regwrite Key, 0
>
> 'send message
>
> 'Write back original value
>
> myWS.Regwrite Key, RegKey
>
>
>
> While this certainly changes the registry, it has no effect on the problem
> unless Outlook is closed and restarted.
>
>
>
> Does anyone know of a way to suppress this message from vba that does not
> involve restarting Outlook?
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
|
|
0
|
|
|
|
Reply
|
Ken
|
2/13/2010 5:49:19 PM
|
|
Thanks Ken - I had seen an earlier reference from you which essentially said
the same thing. In this instance the problem arises because when the message
is created from vba, part of it is selected at the time it is sent. It seems
probable that all that needs to be done is to move the selection point to
the start of the message before issuing the send command for the prompt to
go away. As there won't be any spelling errors in the message (being part of
a mail merge where that will already have been addressed) the spell check
will not prompt for corrections and without the selection being selected, it
won't attempt to spell check in two parts. :)
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:OuMp0UNrKHA.4492@TK2MSFTNGP05.phx.gbl...
> Unfortunately that's just one of a bunch of settings that are read on
> startup and then maintained in memory. So the registry settings are only
> read on startup.
>
> About the only thing I can think of would be a real hack involving Win32
> API stuff to send a WM_CLOSE message to that dialog when it opens,
> monitoring for it opening. Depending on version and whether or not
> WordMail was used there'd probably be different classes for the dialog,
> that would take some work with Spy++.
>
> --
> 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
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:OIyg8VLrKHA.3792@TK2MSFTNGP05.phx.gbl...
>> In developing an application for Word which sends e-mail messages using
>> Outlook, I came across an issue that I have not been able to resolve.
>> Hopefully someone will have a plan :)
>>
>> With Outlook's options configured to spell check the message before
>> sending, each message processed creates the message 'Word finished
>> checking the selection. Do you want to continue the remainder of the
>> document' which requires user intervention. Clearly if the option is
>> switched off in Outlook, the message doesn't occur. As I have no control
>> over whether users have this option set or not, I would like to switch
>> off the spell checkling for the duration of the process and thus avoid
>> the need for user interaction.
>>
>> Solutions posted on the web all seem to revolve around setting the
>> registry entry associated with the option - along the lines of
>>
>> Dim myWS As Object
>>
>> Dim RegKey As String
>>
>> Dim Key As String
>>
>> Dim Ver As Variant
>>
>> Ver = Application.version
>>
>> Key = "HKEY_CURRENT_USER\Software\Microsoft\Office\" _
>>
>> & Ver & "\Outlook\Options\Spelling\Check"
>>
>> Set myWS = CreateObject("WScript.Shell")
>>
>> 'Read key from registry
>>
>> RegKey = myWS.RegRead(Key)
>>
>> 'Write new value
>>
>> myWS.Regwrite Key, 0
>>
>> 'send message
>>
>> 'Write back original value
>>
>> myWS.Regwrite Key, RegKey
>>
>>
>>
>> While this certainly changes the registry, it has no effect on the
>> problem unless Outlook is closed and restarted.
>>
>>
>>
>> Does anyone know of a way to suppress this message from vba that does not
>> involve restarting Outlook?
>>
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>>
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/14/2010 6:14:09 AM
|
|
One other possibility, which probably would only work for WordMail 2003 or
earlier would be to try using Word code to disable spell checking in the
document. You can get at Word from Inspector.WordEditor, which is actually
Word.Document.
Getting WordEditor is restricted in the object model, especially for outside
code, but there is alternative code out there to get WordEditor using Win32
API calls and callbacks, bypassing the Outlook object model. I've posted it
in the past in VB6, let me know if you need me to dig it out.
--
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
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:uMMZtzTrKHA.4752@TK2MSFTNGP04.phx.gbl...
> Thanks Ken - I had seen an earlier reference from you which essentially
> said the same thing. In this instance the problem arises because when the
> message is created from vba, part of it is selected at the time it is
> sent. It seems probable that all that needs to be done is to move the
> selection point to the start of the message before issuing the send
> command for the prompt to go away. As there won't be any spelling errors
> in the message (being part of a mail merge where that will already have
> been addressed) the spell check will not prompt for corrections and
> without the selection being selected, it won't attempt to spell check in
> two parts. :)
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
0
|
|
|
|
Reply
|
Ken
|
2/15/2010 1:51:05 PM
|
|
OK I'll look at that - at the moment (for Office 2007) I am simply reading
the registry entry (where it exists), informing the user and disabling the
function.
Interestingly the issue does not arise when working with the same documents
in Office 2003 with Word as e-mail editor (but then I suppose you have the
issue there of not being able to select Word as e-mail editor from vba - as
one door closes another opens).
Whilst on the subject of Office 2003 the basic code segment (below) that
works in Office 2007 does not work for me in Word 2003. I cannot decide
whether this is because of a problem with the Office 2003 installation, or
whether simply it doesn't work in Office 2003. It works with Word 2003 and
Outlook 2007 and Word 2007 and Outlook 2007, but not Word 2003 and Outlook
2003 - and if it is my installation at fault, I can't put my finger on where
:(
Set oItem = oOutlookApp.CreateItem(olMailItem)
Set objDoc = oItem.GetInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
With oItem
.To = strEMail
.Subject = "Subject"
Selection.Copy
.Display
objSel.Paste
End With
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:uDGZ$YkrKHA.4220@TK2MSFTNGP05.phx.gbl...
> One other possibility, which probably would only work for WordMail 2003 or
> earlier would be to try using Word code to disable spell checking in the
> document. You can get at Word from Inspector.WordEditor, which is actually
> Word.Document.
>
> Getting WordEditor is restricted in the object model, especially for
> outside code, but there is alternative code out there to get WordEditor
> using Win32 API calls and callbacks, bypassing the Outlook object model.
> I've posted it in the past in VB6, let me know if you need me to dig it
> out.
>
> --
> 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
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:uMMZtzTrKHA.4752@TK2MSFTNGP04.phx.gbl...
>> Thanks Ken - I had seen an earlier reference from you which essentially
>> said the same thing. In this instance the problem arises because when the
>> message is created from vba, part of it is selected at the time it is
>> sent. It seems probable that all that needs to be done is to move the
>> selection point to the start of the message before issuing the send
>> command for the prompt to go away. As there won't be any spelling errors
>> in the message (being part of a mail merge where that will already have
>> been addressed) the spell check will not prompt for corrections and
>> without the selection being selected, it won't attempt to spell check in
>> two parts. :)
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/15/2010 2:44:01 PM
|
|
What doesn't work in Word/Outlook 2003 with that code? Any errors or what?
Where is the code running, Word or Outlook? I assume that WordMail is set.
One other question, when is the failing code running? What triggers it, a
button or event or ...?
--
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
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:uxa5P1krKHA.5896@TK2MSFTNGP04.phx.gbl...
> OK I'll look at that - at the moment (for Office 2007) I am simply reading
> the registry entry (where it exists), informing the user and disabling the
> function.
>
> Interestingly the issue does not arise when working with the same
> documents in Office 2003 with Word as e-mail editor (but then I suppose
> you have the issue there of not being able to select Word as e-mail editor
> from vba - as one door closes another opens).
>
> Whilst on the subject of Office 2003 the basic code segment (below) that
> works in Office 2007 does not work for me in Word 2003. I cannot decide
> whether this is because of a problem with the Office 2003 installation, or
> whether simply it doesn't work in Office 2003. It works with Word 2003 and
> Outlook 2007 and Word 2007 and Outlook 2007, but not Word 2003 and Outlook
> 2003 - and if it is my installation at fault, I can't put my finger on
> where :(
>
> Set oItem = oOutlookApp.CreateItem(olMailItem)
> Set objDoc = oItem.GetInspector.WordEditor
> Set objSel = objDoc.Windows(1).Selection
>
> With oItem
> .To = strEMail
> .Subject = "Subject"
> Selection.Copy
> .Display
> objSel.Paste
> End With
>
> 'Clean up
> Set oItem = Nothing
> Set oOutlookApp = Nothing
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
0
|
|
|
|
Reply
|
Ken
|
2/15/2010 3:22:06 PM
|
|
The code is run from Word. The part that doesn't work is the Copy and Paste
part, so the selected text never makes it to the message. I just get an
empty message with the subject and address filled.
It is undoubtedly attributable to having Outlook using its own e-mail
editor, but as I indicated earlier, it doesn't seem possible to switch
editors in vba (unless you know a way).
So
1. I either need a method that works with both editors
or
2. I need two methods - one for each editor,
or
3. I need to be able to switch editors
or
4. I need to disable the function when the wrong editor is pre-selected
For 2 & 4 I was planning to interrogate the registry to see which editor was
in use and set up the code construction accordingly ... but I can't find a
way to paste the text into the Outlook editor :(.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:e22u6KlrKHA.4828@TK2MSFTNGP05.phx.gbl...
> What doesn't work in Word/Outlook 2003 with that code? Any errors or what?
> Where is the code running, Word or Outlook? I assume that WordMail is set.
>
> One other question, when is the failing code running? What triggers it, a
> button or event or ...?
>
> --
> 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
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:uxa5P1krKHA.5896@TK2MSFTNGP04.phx.gbl...
>> OK I'll look at that - at the moment (for Office 2007) I am simply
>> reading the registry entry (where it exists), informing the user and
>> disabling the function.
>>
>> Interestingly the issue does not arise when working with the same
>> documents in Office 2003 with Word as e-mail editor (but then I suppose
>> you have the issue there of not being able to select Word as e-mail
>> editor from vba - as one door closes another opens).
>>
>> Whilst on the subject of Office 2003 the basic code segment (below) that
>> works in Office 2007 does not work for me in Word 2003. I cannot decide
>> whether this is because of a problem with the Office 2003 installation,
>> or whether simply it doesn't work in Office 2003. It works with Word 2003
>> and Outlook 2007 and Word 2007 and Outlook 2007, but not Word 2003 and
>> Outlook 2003 - and if it is my installation at fault, I can't put my
>> finger on where :(
>>
>> Set oItem = oOutlookApp.CreateItem(olMailItem)
>> Set objDoc = oItem.GetInspector.WordEditor
>> Set objSel = objDoc.Windows(1).Selection
>>
>> With oItem
>> .To = strEMail
>> .Subject = "Subject"
>> Selection.Copy
>> .Display
>> objSel.Paste
>> End With
>>
>> 'Clean up
>> Set oItem = Nothing
>> Set oOutlookApp = Nothing
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/15/2010 3:56:26 PM
|
|
If the Outlook editor is being used and the format is HTML you can use
IHTMLDocument and HTML code to paste text, etc. Something like this:
If ((Not (oItem.GetInspector.IsWordMail )) And (Left(oItem.Application, 2) =
"11")) Then
' tested and is OL editor and is OL 11
If oItem.GetInspector.EditorType = olEditorHTML Then
Dim oHTML As MSHTML.IHTMLDocument2
Set oHTML = oItem.GetInspector.HTMLEditor
' now use HTML code
--
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
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:uBWHudlrKHA.732@TK2MSFTNGP06.phx.gbl...
> The code is run from Word. The part that doesn't work is the Copy and
> Paste part, so the selected text never makes it to the message. I just get
> an empty message with the subject and address filled.
>
> It is undoubtedly attributable to having Outlook using its own e-mail
> editor, but as I indicated earlier, it doesn't seem possible to switch
> editors in vba (unless you know a way).
>
> So
> 1. I either need a method that works with both editors
> or
> 2. I need two methods - one for each editor,
> or
> 3. I need to be able to switch editors
> or
> 4. I need to disable the function when the wrong editor is pre-selected
>
> For 2 & 4 I was planning to interrogate the registry to see which editor
> was in use and set up the code construction accordingly ... but I can't
> find a way to paste the text into the Outlook editor :(.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
0
|
|
|
|
Reply
|
Ken
|
2/15/2010 4:13:30 PM
|
|
Hmmm That looks interesting ... thanks :)
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:OC1MXnlrKHA.5356@TK2MSFTNGP02.phx.gbl...
> If the Outlook editor is being used and the format is HTML you can use
> IHTMLDocument and HTML code to paste text, etc. Something like this:
>
> If ((Not (oItem.GetInspector.IsWordMail )) And (Left(oItem.Application, 2)
> = "11")) Then
> ' tested and is OL editor and is OL 11
> If oItem.GetInspector.EditorType = olEditorHTML Then
> Dim oHTML As MSHTML.IHTMLDocument2
> Set oHTML = oItem.GetInspector.HTMLEditor
> ' now use HTML code
>
> --
> 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
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:uBWHudlrKHA.732@TK2MSFTNGP06.phx.gbl...
>> The code is run from Word. The part that doesn't work is the Copy and
>> Paste part, so the selected text never makes it to the message. I just
>> get an empty message with the subject and address filled.
>>
>> It is undoubtedly attributable to having Outlook using its own e-mail
>> editor, but as I indicated earlier, it doesn't seem possible to switch
>> editors in vba (unless you know a way).
>>
>> So
>> 1. I either need a method that works with both editors
>> or
>> 2. I need two methods - one for each editor,
>> or
>> 3. I need to be able to switch editors
>> or
>> 4. I need to disable the function when the wrong editor is pre-selected
>>
>> For 2 & 4 I was planning to interrogate the registry to see which editor
>> was in use and set up the code construction accordingly ... but I can't
>> find a way to paste the text into the Outlook editor :(.
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/16/2010 6:12:38 AM
|
|
Hi Graham,
But doesn't it mean that the message would need to be created as HTML
"text" - that is tags and all?
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
news:upwfI8srKHA.4652@TK2MSFTNGP02.phx.gbl...
> Hmmm That looks interesting ... thanks :)
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> "Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
> news:OC1MXnlrKHA.5356@TK2MSFTNGP02.phx.gbl...
>> If the Outlook editor is being used and the format is HTML you can use
>> IHTMLDocument and HTML code to paste text, etc. Something like this:
>>
>> If ((Not (oItem.GetInspector.IsWordMail )) And (Left(oItem.Application,
>> 2) = "11")) Then
>> ' tested and is OL editor and is OL 11
>> If oItem.GetInspector.EditorType = olEditorHTML Then
>> Dim oHTML As MSHTML.IHTMLDocument2
>> Set oHTML = oItem.GetInspector.HTMLEditor
>> ' now use HTML code
>>
>> --
>> 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
>>
>>
>> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
>> news:uBWHudlrKHA.732@TK2MSFTNGP06.phx.gbl...
>>> The code is run from Word. The part that doesn't work is the Copy and
>>> Paste part, so the selected text never makes it to the message. I just
>>> get an empty message with the subject and address filled.
>>>
>>> It is undoubtedly attributable to having Outlook using its own e-mail
>>> editor, but as I indicated earlier, it doesn't seem possible to switch
>>> editors in vba (unless you know a way).
>>>
>>> So
>>> 1. I either need a method that works with both editors
>>> or
>>> 2. I need two methods - one for each editor,
>>> or
>>> 3. I need to be able to switch editors
>>> or
>>> 4. I need to disable the function when the wrong editor is pre-selected
>>>
>>> For 2 & 4 I was planning to interrogate the registry to see which editor
>>> was in use and set up the code construction accordingly ... but I can't
>>> find a way to paste the text into the Outlook editor :(.
>>>
>>> --
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>> Graham Mayor - Word MVP
>>>
>>> My web site www.gmayor.com
>>> Word MVP web site http://word.mvps.org
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>
>
|
|
0
|
|
|
|
Reply
|
Doug
|
2/16/2010 6:30:16 AM
|
|
I'll tell you when I have had chance to play with it ;) More likely I will
use the simpler get out that we discussed earlier :)
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> wrote in message
news:OnUa3FtrKHA.4652@TK2MSFTNGP02.phx.gbl...
> Hi Graham,
>
> But doesn't it mean that the message would need to be created as HTML
> "text" - that is tags and all?
>
> --
> Hope this helps,
>
> Doug Robbins - Word MVP
>
> Please reply only to the newsgroups unless you wish to obtain my services
> on
> a paid professional basis.
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:upwfI8srKHA.4652@TK2MSFTNGP02.phx.gbl...
>> Hmmm That looks interesting ... thanks :)
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> "Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
>> news:OC1MXnlrKHA.5356@TK2MSFTNGP02.phx.gbl...
>>> If the Outlook editor is being used and the format is HTML you can use
>>> IHTMLDocument and HTML code to paste text, etc. Something like this:
>>>
>>> If ((Not (oItem.GetInspector.IsWordMail )) And (Left(oItem.Application,
>>> 2) = "11")) Then
>>> ' tested and is OL editor and is OL 11
>>> If oItem.GetInspector.EditorType = olEditorHTML Then
>>> Dim oHTML As MSHTML.IHTMLDocument2
>>> Set oHTML = oItem.GetInspector.HTMLEditor
>>> ' now use HTML code
>>>
>>> --
>>> 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
>>>
>>>
>>> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
>>> news:uBWHudlrKHA.732@TK2MSFTNGP06.phx.gbl...
>>>> The code is run from Word. The part that doesn't work is the Copy and
>>>> Paste part, so the selected text never makes it to the message. I just
>>>> get an empty message with the subject and address filled.
>>>>
>>>> It is undoubtedly attributable to having Outlook using its own e-mail
>>>> editor, but as I indicated earlier, it doesn't seem possible to switch
>>>> editors in vba (unless you know a way).
>>>>
>>>> So
>>>> 1. I either need a method that works with both editors
>>>> or
>>>> 2. I need two methods - one for each editor,
>>>> or
>>>> 3. I need to be able to switch editors
>>>> or
>>>> 4. I need to disable the function when the wrong editor is pre-selected
>>>>
>>>> For 2 & 4 I was planning to interrogate the registry to see which
>>>> editor was in use and set up the code construction accordingly ... but
>>>> I can't find a way to paste the text into the Outlook editor :(.
>>>>
>>>> --
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>> Graham Mayor - Word MVP
>>>>
>>>> My web site www.gmayor.com
>>>> Word MVP web site http://word.mvps.org
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>
>>
>>
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/16/2010 6:43:50 AM
|
|
Yes, but you end up doing that anyway in a lot of cases when you start
parsing or fooling around with HTMLBody. When I do something like inserting
text or URL links or whatever I always end up doing that anyway. And if
you're using the IHTMLDocument object models that does help some.
--
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
"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> wrote in message
news:OnUa3FtrKHA.4652@TK2MSFTNGP02.phx.gbl...
> Hi Graham,
>
> But doesn't it mean that the message would need to be created as HTML
> "text" - that is tags and all?
>
> --
> Hope this helps,
>
> Doug Robbins - Word MVP
>
> Please reply only to the newsgroups unless you wish to obtain my services
> on
> a paid professional basis.
|
|
0
|
|
|
|
Reply
|
Ken
|
2/16/2010 2:00:21 PM
|
|
Annoyingly and inexplicably, the original process (that I posted earlier in
the thread) worked on my Office 2003 equipped laptop today - regardless of
whether I was using Word or Outlook's own editor. The only difference is
that the laptop had hibernated overnight. Nothing else had changed :(
In the circumstances I will wait to see if there is any user feedback before
decideing what to do (if anything) next -
http://www.gmayor.com/ManyToOne.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:e14P1BxrKHA.5356@TK2MSFTNGP02.phx.gbl...
> Yes, but you end up doing that anyway in a lot of cases when you start
> parsing or fooling around with HTMLBody. When I do something like
> inserting text or URL links or whatever I always end up doing that anyway.
> And if you're using the IHTMLDocument object models that does help some.
>
> --
> 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
>
>
> "Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> wrote in message
> news:OnUa3FtrKHA.4652@TK2MSFTNGP02.phx.gbl...
>> Hi Graham,
>>
>> But doesn't it mean that the message would need to be created as HTML
>> "text" - that is tags and all?
>>
>> --
>> Hope this helps,
>>
>> Doug Robbins - Word MVP
>>
>> Please reply only to the newsgroups unless you wish to obtain my services
>> on
>> a paid professional basis.
>
|
|
0
|
|
|
|
Reply
|
Graham
|
2/16/2010 2:57:56 PM
|
|
|
12 Replies
722 Views
(page loaded in 0.239 seconds)
|