objWord.Application.Documents(1).SaveAs & error 5096

  objWord.Application.Documents(1).SaveAs

 

ran multiple times and now I am receiving an 5096 error.

 

objDoc.MailMerge.Destination = wdSendToNewDocument
objDoc.MailMerge.Execute

'save the merged document with a descriptive name
' you can delete this next line if you don't want to save
' the merged document ' it will leave the document with the default name
'"Labels 1"  or "Letters 1"
objWord.Application.Documents(1).SaveAs (strMergedDocName & ".docx")
objWord.Application.Documents(1).Close wdDoNotSaveChanges

Answer
Answer

  objWord.Application.Documents(1).SaveAs

 

ran multiple times and now I am receiving an 5096 error.

 

objDoc.MailMerge.Destination = wdSendToNewDocument
objDoc.MailMerge.Execute

'save the merged document with a descriptive name
' you can delete this next line if you don't want to save
' the merged document ' it will leave the document with the default name
'"Labels 1"  or "Letters 1"
objWord.Application.Documents(1).SaveAs (strMergedDocName & ".docx")
objWord.Application.Documents(1).Close wdDoNotSaveChanges


I assume that strMergedDocName is something that is a valid path\field name.

It may be a timing issue that you could overcome by using an OnTime construction.  However try using

objWord.ActiveDocument.SaveAs

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated July 2, 2022 Views 36 Applies to: