Solved

vfp-9 ole word automation error with word 2010/acrobat x

Posted on 2014-12-02
7
450 Views
Last Modified: 2014-12-12
Hi:
I have a VFP app that uses OLE word automation to merge data and create/print documents. It has worked for years with WIN-XP and Office-2003 with Acrobat Standard-6.

We are now upgrading to Win-7 and Office-2010 with Acrobat Standard-X (10). Even after many internet searches and changes to Word settings, etc., my program will not run and returns error #1429. It keeps saying 'unable to run the specified macro', which is Adobe PDFMaker. yet the macro is listed in the Word Add-Ins and everything looks OK. I have also checked "enable ALL" macros in Word AND downgraded Office-2010 to the 32bit version.

Here is the code:

  oWord = CreateObject("Word.Application")
 
     WITH oWord
      .Run("AdobePDFMaker.AutoExec.Main")
      .Documents.Open((M_Doc))                                    && Open Copy of Master
      .Documents((M_Doc)).Activate
      .Documents((M_Doc)).MailMerge.Execute                && Run the merge
      .Documents((M_Doc)).Close                                    && Close Copy of Master
      .ActiveDocument.SaveAs(sys(5)+ALLTRIM(M_NewLoc)+ALLTRIM(M_NewName))      && Save new Document
 
      .Visible = .T.                  && View for editing/printing/re-saving/closing
      .Activate()
          
      ENDWITH
        
  RELEASE oWord

Any help would be greatly appreciated - really in a bind here.

Thanks.

Cathie
NYC
0
Comment
Question by:ramramcat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 40475728
I suppose the error is reported on the  ".Run( ... )" line.

How the Word macro uses Adobe Acrobat? I suppose via OLE automation. Then you have to use Adobe Acrobat Professional because the Standard version does not support OLE automation.
0
 

Author Comment

by:ramramcat
ID: 40480036
Hi,
I downloaded and installed Acrobat-XI Professional (was not able to get a trial download of Acrobat-X Pro), but still am unable to run the above code; .

Is there a way to create mail-merge letters programmatically without referencing PDFMaker? This was written a very long time ago and I don't remember.

Thanks.
0
 

Author Comment

by:ramramcat
ID: 40480041
FYI, it did not work to asterisk-out the  ".Run( ... )" line.
0
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
LVL 42

Expert Comment

by:pcelba
ID: 40480473
What line of code reports the error 1429?

You should also check if appropriate Word add-on is installed. Look e.g. here: http://helpx.adobe.com/acrobat/using/creating-pdfs-pdfmaker-windows.html

If everything fails then remember you don't need Acrobat to create PDF output. You may use almost any PDF printer driver, e.g. http://www.pdfforge.org/pdfcreator

And finally you should be able to save the Word document as PDF directly:
http://www.robvanderwoude.com/vbstech_automation_word.php
http://msdn.microsoft.com/en-us/library/office/ff839952%28v=office.15%29.aspx

Mailmerge from FoxPro was described many times:
http://www.tek-tips.com/viewthread.cfm?qid=1500523
http://www.tomorrowssolutionsllc.com/Conference%20Sessions/Automating%20Microsoft%20Word.pdf

Tamar's code samples and other papers are available here: http://www.tomorrowssolutionsllc.com/publications/conferencepapers
0
 

Author Comment

by:ramramcat
ID: 40495472
Sorry to abandon this question. Our client does not want to invest in changing their (old) VFP program to work with Win7 and is keeping the program on a Win-XP PC for now.

I'm not sure what to do with the question and points.

Thanks.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 40495939
Yes, new operating system and other necessary software brings certain incompatibilities and you have to update the FoxPro app code and/or use different add-on software. That's the reality for software unsupported by its vendor (VFP in Microsoft).

Community is able to find working solution but it does not mean "no work"... To stay with XP is the easiest and cheapest way. You may even use your app in Virtual PC environment with XP OS and old Office installed. Everything else can run in the new OS. You just have to evaluate possible risks. XP is also unsupported software (except some ATM versions).

Points are not important. To stay on XP is one of possible solutions. :-)
0
 

Author Closing Comment

by:ramramcat
ID: 40497399
We'll most likely revisit this issue in the future. Thanks for your help.
0

Featured Post

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question