Word add-in craches in outlook

T

Tim Wentzlau

I have a word add-in developed in delphi that works perfectly in word. But
when it is used in outlook with word as a mail editor the add-in craches word
with the following exception "access violation at address 30004d94 read of
adress 00000000"

it happens when i try to set
wordApp.selection.start:=10



i have the problem in office XP (haven't tested other versions yet)

Tim
 
K

Ken Slovak - [MVP - Outlook]

In general Word addins shouldn't do their thing in WordMail. That's due to
how Word is subclassed as an editor by Outlook for WordMail. In Outlook 2007
WordMail is the only option and is provided by a separate Word dll so a Word
addin won't even run in that version.
 
T

Tim Wentzlau

Hi Ken

I have just discovered that my problem is due to a wrong thread
synchronisation i was accessing word directly from a thread not the main
thread.

I am developing solutions for dyslexics and would like to know how i am able
to access the text in the word e-mail editor in outlook 2007.
 
K

Ken Slovak - [MVP - Outlook]

From within Outlook code any open item is in an Inspector object.
Inspector.WordEditor is the Word document object. According to the Outlook
object model help there are limitations though in what you can access from
there, these aren't available:

Tables.Add
Range.ConvertToTable
InlineShapes.AddChart
Range.InsertXML
Selection.InsertXML
Range.ImportFragment

Also, take a look at http://www.outlookcode.com/article.aspx?id=59, which
lists other things you should know about WordMail in Outlook 2007.
 

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