Reply
 
Thread Tools Display Modes
  #1   Report Post  
strider235
 
Posts: n/a
Default using VB from Access worked with Word/Access2000, not 2002

I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don

  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don



  #3   Report Post  
strider235
 
Posts: n/a
Default

Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don




  #4   Report Post  
Doug Robbins
 
Posts: n/a
Default

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don






  #5   Report Post  
strider235
 
Posts: n/a
Default

Hi Doug,
I've tried a half dozen times or more over the last 3 days to access this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don









  #6   Report Post  
Doug Robbins
 
Posts: n/a
Default

Hi Don,

I am not sure what the problem is with the website, but if you send me your
email address, I can send you a copy of the zip file that you would have
downloaded from the site.

You will have to de-spam the address.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
I've tried a half dozen times or more over the last 3 days to access this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on
the
Dim statement.
I have also tried some code with set oDoc =
CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused
because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs
a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the
last
line. I have used the VB debugger with watch points and 'oDoc' is
the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don









  #7   Report Post  
J_Gold
 
Posts: n/a
Default

Hi Don - the site appears to have moved to:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Scroll down to find Super Easy Mail merge.

Cheers,

Angela


"Doug Robbins" wrote in message
...
Hi Don,

I am not sure what the problem is with the website, but if you send me your
email address, I can send you a copy of the zip file that you would have
downloaded from the site.

You will have to de-spam the address.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
I've tried a half dozen times or more over the last 3 days to access this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on
the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused
because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the
last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don











  #8   Report Post  
Doug Robbins
 
Posts: n/a
Default

Thanks Angela.

Don't know if you have ever met Albert, but even Steve Ballmer mistook him
for Bill Gates, doing a double take when he saw Albert sitting in the
audience of a presentation he was making.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"J_Gold" wrote in message
...
Hi Don - the site appears to have moved to:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Scroll down to find Super Easy Mail merge.

Cheers,

Angela


"Doug Robbins" wrote in message
...
Hi Don,

I am not sure what the problem is with the website, but if you send me
your email address, I can send you a copy of the zip file that you would
have downloaded from the site.

You will have to de-spam the address.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
I've tried a half dozen times or more over the last 3 days to access
this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon
your
suggestion) and got the error: "User-defined data type not defined"
on the
Dim statement.
I have also tried some code with set oDoc =
CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused
because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on
a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that
performs a
mailmerge. It works great for Word/Access 2000. Here is a
fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the
last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the
last
line. I have used the VB debugger with watch points and 'oDoc' is
the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don













  #9   Report Post  
strider235
 
Posts: n/a
Default

Hi,
Thanks for the update. I made some modifications to the code as suggested by
this code and other sites. I'm making progress on getting the code to run
under Office 2003 but still have a couple of problems. FYI, I can run the
mailmerge manually, so the main document is working OK.
1. On the OpenDataSource, the document prompts for a table to use as a
source. I have tried
SQLStatement = "QUERY Select * from [Docs];"
and
Connection:="TABLE Docs", _
SubType:=wdMergeSubTypeWord2000
as suggested by micro$oft with no luck. I still get prompted for a table
2. The doctype is catalog (now directory). I tried:
.MainDocumentType = wdCatalog
However, a Letter type document is still produced, with one line per page
rather than a bunch of lines per page.
Ideas? Thanks?


"J_Gold" wrote:

Hi Don - the site appears to have moved to:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Scroll down to find Super Easy Mail merge.

Cheers,

Angela


"Doug Robbins" wrote in message
...
Hi Don,

I am not sure what the problem is with the website, but if you send me your
email address, I can send you a copy of the zip file that you would have
downloaded from the site.

You will have to de-spam the address.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
I've tried a half dozen times or more over the last 3 days to access this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on
the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused
because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the
last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don












  #10   Report Post  
strider235
 
Posts: n/a
Default

One discouraging thing that I've noticed is that the main merge doc is
configured properly when I open it manually: type=Directory, query is
correct. However, if I set a breakpoint in the Access code and step through
the Open of that file, it no longer has the correct attributes; it's now
type=Letters, for example. And my code that sets MainDocumentType=wdDirectory
has no effect.
Gee, this stuff runs so very well in 2000. Why did we need a new version
again???




"strider235" wrote:

Hi,
Thanks for the update. I made some modifications to the code as suggested by
this code and other sites. I'm making progress on getting the code to run
under Office 2003 but still have a couple of problems. FYI, I can run the
mailmerge manually, so the main document is working OK.
1. On the OpenDataSource, the document prompts for a table to use as a
source. I have tried
SQLStatement = "QUERY Select * from [Docs];"
and
Connection:="TABLE Docs", _
SubType:=wdMergeSubTypeWord2000
as suggested by micro$oft with no luck. I still get prompted for a table
2. The doctype is catalog (now directory). I tried:
.MainDocumentType = wdCatalog
However, a Letter type document is still produced, with one line per page
rather than a bunch of lines per page.
Ideas? Thanks?


"J_Gold" wrote:

Hi Don - the site appears to have moved to:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Scroll down to find Super Easy Mail merge.

Cheers,

Angela


"Doug Robbins" wrote in message
...
Hi Don,

I am not sure what the problem is with the website, but if you send me your
email address, I can send you a copy of the zip file that you would have
downloaded from the site.

You will have to de-spam the address.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
I've tried a half dozen times or more over the last 3 days to access this
URL - cannot find server. Can you summarize?
Thanks,
Don


"Doug Robbins" wrote:

Take a look at the "Super easy Word merge" item on fellow MVP Albert
Kallal's website at:

http://www.attcanada.net/~kallal.msn.../msaccess.html


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
Hi Doug,
Thanks for the response. I'd tried that previously (and again upon your
suggestion) and got the error: "User-defined data type not defined" on
the
Dim statement.
I have also tried some code with set oDoc = CreateObject("Word.Document")
and tried working with oDoc to no avail.
Regards,
Don


"Doug Robbins" wrote:

I would suggest that you dim mergedoc as Document, then use
Set mergedoc = Documents.Open(Filename:= Path & "Merge.doc")
mergedoc.MailMerge.Destination = wdSendToNewDocument

to make sure that the document you are trying to use is actually the
mailmerge main document. Chances are that your problem is caused
because
the ActiveDocument is not what you think it is

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"strider235" wrote in message
...
I've written some VB code behind an Access form button that performs a
mailmerge. It works great for Word/Access 2000. Here is a fragment:

Set oApp = CreateObject("Word.Application")
With oApp
' US Doc
.Visible = True
.Documents.Open FileName:=Path & "Merge.doc"
.ActiveDocument.MailMerge.Destination = wdSendToNewDocument

For 2002 I get a msg "Requested object is not available" on the last
line.

I made changes to the code:
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open FileName:=Path & "Merge.doc"
Set oDoc = oApp.ActiveDocument
oDoc.Mailmerge.Destination = wdSendToNewDocument

and still get the error "Requested object is not available" on the
last
line. I have used the VB debugger with watch points and 'oDoc' is the
document I expect it to be with mailmerge properties.
Ideas?
Thanks,
Don












Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I Mail Merge from an Access Query? geordymac Mailmerge 2 February 9th 05 07:59 AM
why word 2000 mail merge opens multiple instances of access table. Johnny C. Mailmerge 0 February 3rd 05 05:11 PM
Word 97 opening Access 2000 RS200Phil Mailmerge 2 January 31st 05 02:54 PM
original office 2k access dbase merge with word2k worked fine. no. martyn @ kingsmead marquees, england Mailmerge 1 December 10th 04 02:29 AM
Word mail merge with Access Linda Mailmerge 1 December 7th 04 11:46 PM


All times are GMT +1. The time now is 01:51 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"