PDA

View Full Version : Object not available? My code is wrong but I can't see why.



DanielHowden
07-25-2011, 07:03 AM
I am trying to capture some data that is stored in a mail merge data source but I can't get it to work. This is the line I am using:-

TheDataValue = ActiveDocument.MailMerge.DataSource.DataFields.Item(2).Value

I get the following error:-

Run-time error'5852':
Requested object is not available.

Cheers Daniel.

DanielHowden
07-25-2011, 07:53 AM
I found that after the execute command the mail merge data is purged, so you need to use it before you execute.

Cheers Daniel.