Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Using Acrobat menu from vba; Acrobat menu not available in Word.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 02 Apr 2007 19:02 GMT
Hi! Sorry for the second repost - my 1st one did not get any responses.

Here's my problem: when I programmatically convert Word documents to
PDF via Print to PDF driver, the resulting PDF does not contain embedded links
found in original Word documents. I figured if I find a way to execute
“Adobe PDF” -> “Convert to Adobe PDF” option of Acrobat Add-in, I can solve
the problem of missing links.

When I open the document manually, I can see the “Adobe PDF” option on the
menu bar. When I open the document programmatically, the menubar does not
contain “Adobe PDF” option. As a result, my code can not execute.

I also tried to execute the macros directly from my C# WinForm application
but was getting Unable to Execute Macro exception which I am sure is related
to the aforementioned problem.

  Application.Run MacroName:="AdobePDFMakerA.AutoExec.Main"
   Application.Run MacroName:="AdobePDFMakerA.AutoExec.ConvertToPDF"

Here’s how I open Word documents in code:

private Word.ApplicationClass wordApp = null;

. . . . . .

doc = wordApp.Documents.Open(
ref objOrgDoc,    //FileName
ref objMissing,   //ConfirmVersions
ref objMissing,   //ReadOnly
ref objMissing,   //AddToRecentFiles
ref objMissing,   //PasswordDocument
ref objMissing,   //PasswordTemplate
ref objMissing,   //Revert
ref objMissing,   //WritePasswordDocument
ref objMissing,   //WritePasswordTemplate
ref objMissing,   //Format
ref objMissing,   //Enconding
ref objMissing,     //Visible
ref objMissing,   //OpenAndRepair
ref objMissing,   //DocumentDirection
ref objMissing,   //NoEncodingDialog
ref objMissing    //XMLTransform
);

What can I do to execute the menu option programmatically? What am I doing
wrong?
Is there a way to force Adobe to “show up”?

Word 2003, Acrobat 6 & 7

Many thanks in advance,

--Michael
Jonathan West - 03 Apr 2007 15:24 GMT
Hi Mike,

Some things to check

1. See if an Add-in called "PDFMaker.dot" is a member of the Addins
collection, and that its Installed property is true. if that is not so, then
the macros of the addin are not available

2. Try changing the command to Application.Run "ConvertToPDF"

Unless there is more than one ConvertToPDF macro loaded, it should work
perfectly well.

3. Do you have the full commercial version of Acrobat installed, or just the
free Reader?

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Hi! Sorry for the second repost - my 1st one did not get any responses.
>
[quoted text clipped - 52 lines]
>
> --Michael
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.