I'd previously posted this, but it has since rolled off the newsgroup, and
of course, I've forgotten what the solution was. Any help is greatly
appreciated...
I've run into a curious problem when automating a
document from Office 2003. I've tried this with VB6 and
VB.NET with the same result.
I have a mail merge document, with the data source saved,
and I open the document using something like:
Dim wrdApp as New Word.Application
wrdApp.Open(FileName:="MailMerge.Doc")
wrdApp.Visible = True
When the document is opened, it's opened as a Normal Word
Document, it's no longer a Mail Merge Letter. We use the
wrdDocument.MailMerge.State to return the document type,
and do special processing on Mail Merge docs.
Oddly, if I close Word, and open the document directly,
without automation, it opens as a MailMerge doc. This
only seems to happen with Office 2003, not with Office
2002 or 2000. Any idea's would be greatly appreciated!
Graham Mayor - 02 Jan 2004 14:41 GMT
The original thread was
http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=1d6
b8b3dc2336861&seekm=%23lU039%23kDHA.2012%40TK2MSFTNGP12.phx.gbl#link1

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gmayor@mvps.org
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
> I'd previously posted this, but it has since rolled off the
> newsgroup, and of course, I've forgotten what the solution was. Any
[quoted text clipped - 20 lines]
> only seems to happen with Office 2003, not with Office
> 2002 or 2000. Any idea's would be greatly appreciated!
Jerry - 06 Jan 2004 21:48 GMT
Try this instead, it worked for me:
Dim objWord As Word.Document
Set objWord = GetObject("<filename>", "Word.Document")
objWord.Application.Visible = True
objWord.Application.Activate
You must have a reference to word 11 objects in the vba.
Jerry
>-----Original Message-----
>I'd previously posted this, but it has since rolled off the newsgroup, and
[quoted text clipped - 23 lines]
>
>.
Rick - 26 Jan 2004 04:06 GMT
I think I have your answer. I was also having a problem very similar to yours. I was opening a mailmerge doc from within access and it would not merge. What seems to happen is that an information dialog appears reminding you about the sql statement that will open your merge. I have found a registry key you need to add that will disable that information box, which in turn will keep your document a mail merge instead of a normal document (kbinfo KB825765) It worked for me I think it will work for you as well
----- Kevin McBride wrote: ----
I'd previously posted this, but it has since rolled off the newsgroup, an
of course, I've forgotten what the solution was. Any help is greatl
appreciated..
I've run into a curious problem when automating
document from Office 2003. I've tried this with VB6 an
VB.NET with the same result
I have a mail merge document, with the data source saved
and I open the document using something like
Dim wrdApp as New Word.Applicatio
wrdApp.Open(FileName:="MailMerge.Doc"
wrdApp.Visible = Tru
When the document is opened, it's opened as a Normal Wor
Document, it's no longer a Mail Merge Letter. We use th
wrdDocument.MailMerge.State to return the document type
and do special processing on Mail Merge docs
Oddly, if I close Word, and open the document directly
without automation, it opens as a MailMerge doc. Thi
only seems to happen with Office 2003, not with Offic
2002 or 2000. Any idea's would be greatly appreciated
dixie - 28 Jan 2004 06:01 GMT
I am having a very similar problem and unfortunately, I too have not seen
the previous messages. I am in the position of having an Access 2000
database that sends out a data text file and then automates by opening a
mailmerge template where the text file is the source. It is now giving
messages indicating that the document is not a mailmerge main document. If
anyone has a workaround, I really need to find out quickly as this is in an
applciation that is running on A2k, AXP and just now, A2003. It is sending
me around the twist as I don't have 2003 to fiddle with as I develop in
2000.
dixie
> I think I have your answer. I was also having a problem very similar to yours. I was opening a mailmerge doc from within access and it would not
merge. What seems to happen is that an information dialog appears reminding
you about the sql statement that will open your merge. I have found a
registry key you need to add that will disable that information box, which
in turn will keep your document a mail merge instead of a normal document
(kbinfo KB825765) It worked for me I think it will work for you as well.
> ----- Kevin McBride wrote: -----
>
[quoted text clipped - 22 lines]
> only seems to happen with Office 2003, not with Office
> 2002 or 2000. Any idea's would be greatly appreciated!