Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Wed, 2 Jul 2008 12:51:46 -0500,    group: microsoft.public.word.mailmerge.fields        back       


Mailmerge issue   
Hi
There is  macro defined in one of the word document.

one of the line is
.Destination = wdSendToNewDocument
I am getting an error saying that requested object not found.I checked
under preferences and saw that microsoft word lib is checked.

Any ideas?
P.S I am not a developer.
Thanks for all your help

manish
date: Wed, 2 Jul 2008 12:51:46 -0500   author:   Manish

Re: Mailmerge issue   
Hi Manish,

The problem could be caused by an error in your coding earlier on. What's the the code for rest of this sub?

Cheers


"Manish"  wrote in message news:1qn256bqm4dm4$.176t29yq6p0a3$.dlg@40tude.net...
> Hi
> There is  macro defined in one of the word document.
> 
> one of the line is
> .Destination = wdSendToNewDocument
> I am getting an error saying that requested object not found.I checked
> under preferences and saw that microsoft word lib is checked.
> 
> Any ideas?
> P.S I am not a developer.
> Thanks for all your help
> 
> manish
date: Thu, 3 Jul 2008 10:55:21 +1000   author:   macropod lid

Re: Mailmerge issue   
On Thu, 3 Jul 2008 10:55:21 +1000, macropod wrote:

> Hi Manish,
> 
> The problem could be caused by an error in your coding earlier on. What's the the code for rest of this sub?
> 
> Cheers
> 
> 
> "Manish"  wrote in message news:1qn256bqm4dm4$.176t29yq6p0a3$.dlg@40tude.net...
>> Hi
>> There is  macro defined in one of the word document.
>> 
>> one of the line is
>> .Destination = wdSendToNewDocument
>> I am getting an error saying that requested object not found.I checked
>> under preferences and saw that microsoft word lib is checked.
>> 
>> Any ideas?
>> P.S I am not a developer.
>> Thanks for all your help
>> 
>> manish

The thing is that the macro runs on all the machines except 2 of them.
So i am wondering if something is missing on those machines.
The rest of the code is

Public Sub MAIN()
    With ActiveDocument.MailMerge
        .Destination = wdSendToNewDocument (fails here)
        .Execute
        
    End With
    Documents("InvoiceCoversheetmm.doc").Close 		
SaveChanges:=wdDoNotSaveChanges
    Rem ActiveDocument.SaveAs FileName:="C:\AMAPS\InvoiceCoverSheet.doc",
FileFormat:= _
    Rem     wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
    Rem     True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
    Rem     False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
    Rem     SaveAsAOCELetter:=False
    Rem Dim Counter
    Rem Counter = 0
    Rem While Counter < 1000000
    Rem     Counter = Counter + 1
    Rem Wend
    Rem Application.PrintOut PrintBackground = True,
FileName:="C:\AMAPS\InvoiceCoverSheet.doc"
    Rem Application.Quit (wdDoNotSaveChanges)
End Sub

Thanks
manish
date: Tue, 8 Jul 2008 10:00:56 -0500   author:   Manish

Re: Mailmerge issue   
Hi Manish,

Well, if the code runs correctly on other machines, then there's a problem with the machines it doesn't run on - not with the code, 
per se.

Have you tried running 'Office Diagnostics' (Office 2007) or 'Detect & Repair' (Office 2000 +) to correct any installation problems? 
Have you also checked that the faulty PCs are fully updated with their Office installations? And, have you checked that the faulty 
PCs have the same vba references set as the good ones?

-- 
Cheers
macropod
[MVP - Microsoft Word]


"Manish"  wrote in message news:1iwr9j67f8z83.16nr9nfbsb0f8$.dlg@40tude.net...
> On Thu, 3 Jul 2008 10:55:21 +1000, macropod wrote:
>
>> Hi Manish,
>>
>> The problem could be caused by an error in your coding earlier on. What's the the code for rest of this sub?
>>
>> Cheers
>>
>>
>> "Manish"  wrote in message news:1qn256bqm4dm4$.176t29yq6p0a3$.dlg@40tude.net...
>>> Hi
>>> There is  macro defined in one of the word document.
>>>
>>> one of the line is
>>> .Destination = wdSendToNewDocument
>>> I am getting an error saying that requested object not found.I checked
>>> under preferences and saw that microsoft word lib is checked.
>>>
>>> Any ideas?
>>> P.S I am not a developer.
>>> Thanks for all your help
>>>
>>> manish
>
> The thing is that the macro runs on all the machines except 2 of them.
> So i am wondering if something is missing on those machines.
> The rest of the code is
>
> Public Sub MAIN()
>    With ActiveDocument.MailMerge
>        .Destination = wdSendToNewDocument (fails here)
>        .Execute
>
>    End With
>    Documents("InvoiceCoversheetmm.doc").Close
> SaveChanges:=wdDoNotSaveChanges
>    Rem ActiveDocument.SaveAs FileName:="C:\AMAPS\InvoiceCoverSheet.doc",
> FileFormat:= _
>    Rem     wdFormatDocument, LockComments:=False, Password:="",
> AddToRecentFiles:= _
>    Rem     True, WritePassword:="", ReadOnlyRecommended:=False,
> EmbedTrueTypeFonts:= _
>    Rem     False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
>    Rem     SaveAsAOCELetter:=False
>    Rem Dim Counter
>    Rem Counter = 0
>    Rem While Counter < 1000000
>    Rem     Counter = Counter + 1
>    Rem Wend
>    Rem Application.PrintOut PrintBackground = True,
> FileName:="C:\AMAPS\InvoiceCoverSheet.doc"
>    Rem Application.Quit (wdDoNotSaveChanges)
> End Sub
>
> Thanks
> manish
date: Wed, 9 Jul 2008 08:00:59 +1000   author:   macropod lid

Re: Mailmerge issue   
You will see this message if there is no MailMerge object in the document, 
and that will happen if Word did not open the datasource.

At the moment I would say there are two strong possibilities why thiat would 
happen on some machines and not others:
 a. http://support.microsoft.com/kb/825765/en-us has been applied on some 
machines and not others
 b. Word updates are more up-to-date on some machines than others (a fairly 
recent security update has altered Word's behaviour when it is opening 
MailMerge documents).

-- 
Peter Jamieson
http://tips.pjmsn.me.uk

"Manish"  wrote in message 
news:1iwr9j67f8z83.16nr9nfbsb0f8$.dlg@40tude.net...
> On Thu, 3 Jul 2008 10:55:21 +1000, macropod wrote:
>
>> Hi Manish,
>>
>> The problem could be caused by an error in your coding earlier on. What's 
>> the the code for rest of this sub?
>>
>> Cheers
>>
>>
>> "Manish"  wrote in message 
>> news:1qn256bqm4dm4$.176t29yq6p0a3$.dlg@40tude.net...
>>> Hi
>>> There is  macro defined in one of the word document.
>>>
>>> one of the line is
>>> .Destination = wdSendToNewDocument
>>> I am getting an error saying that requested object not found.I checked
>>> under preferences and saw that microsoft word lib is checked.
>>>
>>> Any ideas?
>>> P.S I am not a developer.
>>> Thanks for all your help
>>>
>>> manish
>
> The thing is that the macro runs on all the machines except 2 of them.
> So i am wondering if something is missing on those machines.
> The rest of the code is
>
> Public Sub MAIN()
>    With ActiveDocument.MailMerge
>        .Destination = wdSendToNewDocument (fails here)
>        .Execute
>
>    End With
>    Documents("InvoiceCoversheetmm.doc").Close
> SaveChanges:=wdDoNotSaveChanges
>    Rem ActiveDocument.SaveAs FileName:="C:\AMAPS\InvoiceCoverSheet.doc",
> FileFormat:= _
>    Rem     wdFormatDocument, LockComments:=False, Password:="",
> AddToRecentFiles:= _
>    Rem     True, WritePassword:="", ReadOnlyRecommended:=False,
> EmbedTrueTypeFonts:= _
>    Rem     False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
>    Rem     SaveAsAOCELetter:=False
>    Rem Dim Counter
>    Rem Counter = 0
>    Rem While Counter < 1000000
>    Rem     Counter = Counter + 1
>    Rem Wend
>    Rem Application.PrintOut PrintBackground = True,
> FileName:="C:\AMAPS\InvoiceCoverSheet.doc"
>    Rem Application.Quit (wdDoNotSaveChanges)
> End Sub
>
> Thanks
> manish
date: Wed, 9 Jul 2008 10:19:34 +0100   author:   Peter Jamieson

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us