Mark A Matte
markamatte at hotmail.com
Thu Jan 24 12:52:40 CST 2008
Rocky, Below is a link discussing late binding and word automation. It appears to give a workaround for this type of issue about 1/4 down the page: http://www.thescripts.com/forum/thread189594.html ***************SNIP****************** wdSendToNewDocument is a named constant or something like that. What if you cheat and do something like ?wdSendToNewDocument in the immediate window, get the number/value associated with this variable and use that number instead? Does it work?" ***************SNIP****************** Good Luck, Mark A. Matte > From: rockysmolin at bchacc.com > To: accessd at databaseadvisors.com > Date: Thu, 24 Jan 2008 06:56:42 -0800 > Subject: [AccessD] Mail Merge > > Dear List: > > I'm still struggling with this word merge thing. The code I'm looking at I > thought was working previously. I cribbed it right out of Balter's > Mastering Access 97 Development. I'm using A2K3. No references missing. > > It's not very much code. strDocName contains a valid document and it > actually opens: > > > Dim objWord As Object > > Set objWord = CreateObject("Word.Application") > > With objWord > 'Visible is set True in order to view the operation. > .Visible = True > .Documents.Open (strDocName) > .ActiveDocument.MailMerge.Destination = wdSendToNewDocument > .ActiveDocument.MailMerge.SuppressBlankLines = True > .ActiveDocument.MailMerge.Execute > End With > > It blows up on " .ActiveDocument.MailMerge.Destination = > wdSendToNewDocument" with an error "Requested Object is not Available". > > I've had this 'Object Not Available' problem before but due to my advanced > age cannot remember what the fix is. > > Does anyone have a hint why this is failing at that point? > > MTIA, > > Rocky > > > > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller > Sent: Wednesday, January 23, 2008 8:15 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Mail Merge > > Helen Feddema's site has lots such things. Her specialty is Office > integration. Google will take you there quickly. > > A. > > On 1/23/08, Rocky Smolin at Beach Access Software > wrote: >> >> Dear List: >> >> I need to do a simple Mail Merge Access-->Word and don't want to >> reinvent the wheel. Is there a canned routine on line that I could >> crib? I checked Lebans but didn't see anything. >> >> MTIA >> >> Rocky >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.19.8/1236 - Release Date: 1/21/2008 > 8:23 PM > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com _________________________________________________________________ Helping your favorite cause is as easy as instant messaging. You IM, we give. http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join