wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToPrinter

This line of code gives an error saying requested object is not available
Does anyone know why? If so can you point me in the right direction to fix it.

Have you set your references to include Word? If not then the code will not understand what you are doing. Have you used Word in other parts of your code and it work? It might help put the code up so we can see it. You may have a problem elsewhere in your code and it does not become evident until the referenced statement.

Chester

Yes I have a reference to word. I found out that this line works under service pack 2 but not under service pack 3 which is what I am currently using. Any reason why it would work under sp2 but not sp3. Do I have to change my references after the update is done.

I am not sure, but I think SP3 may change the core from 10 to 11. This may be the problem. Check to see what Office and Word Objects version you are referencing.

Chester

Currently it is referencing 10 but I'll check to see if that is the problem. Thanks.

I found your question posted a few months ago.

wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToPrinter

This line of code gives an error saying requested object is not available

I have the same problem as yours. It works totally fine in Service pack 2, but it doesn't work for service packe 3. How did you solve the problem?

In your post, you mention you change your reference. How can i find the reference. I have no idea about the reference. Can you share your solution? Many thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.