serious Mailenvelope error .net

T

tingletanglebob

Hi there

I have some trouble with the Mailenvelope property in Word. I want to change
the default subject for an active document. This works fine with VBA.

If I want to do this in word it always comes "with instance to an object on
set" or system.executionengineexception. Please no comments to the objects
and instanciating of them - I know how that works. The problem is that my
Active document is completely available in the debugger and the mailenvelope
is a proper object acording to the debugger, but when I want to assign the

.....activedocument.mailenvelope.introduction = "something"

or

....activedocument.mailenvelope.item.subject = "something"

than I get "object or reference not set"

The weird thing is, if I assign it manually in the immidate window and click
afterwards onto the mail button in word, the introduction and subject are
filled like aspected and I dont get any error messages.

What is the problem, why is this working with the same object reference in
the immidate window but not in the code window?

sample:

Doc.MailEnvelope.Item.Subject = "test subject"

works in immidiate window

not in code ????????????????????????????

I appreciate any help
 

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

Similar Threads


Top