Batch conversion with Office AddIn by addressing Command Bar

This Forum is for the use of End Users requiring help and assistance for Tracker Software's OFFice2PDF and MS Office Addin Applications - supplied with PDF-XChange.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
koch000c
User
Posts: 2
Joined: Wed Jan 16, 2013 2:34 pm

Batch conversion with Office AddIn by addressing Command Bar

Post by koch000c »

I have frequently the task to execute a batch conversion of about 100 .doc files to pdf. Using the "Office2pdf" tool does not satisfy my needs because specified format templates in the .doc file are not transferred to bookmarks in the .pdf output file. Therefore I use the Office AddIn which works very well. For batch conversion under Word 2003 I used the following code in Visual Basic:

CommandBars("PDF-XChange 4.0").Controls("Umwandeln in PDF").Execute

However, this does no longer work with Word 2010 as there is no longer the CommandBar object "PDF-XChange 4.0", but only a tab within the Ribbon.

Instead I would expect some code as follows to be functional:

CommandBars.ExecuteMso("Umwandeln in PDF")

or

CommandBars.ExecuteMso(Id_No)

Is there still any kind of simple code like that available to address the Office AddIn by VB code? Otherwise last resort to think of would be trying to use some SendKey commands.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Batch conversion with Office AddIn by addressing Command

Post by Tracker Supp-Stefan »

Hello koch000c,

I spoke with one of my colleagues working on the add-in for MS Office, and he told me that the ribbon button ID is:
PDFXC4_CreatePDF
But he can't guarantee that you calling this from VB will work.

Still we would recommend you to try this and see if it works.

Best,
Stefan
koch000c
User
Posts: 2
Joined: Wed Jan 16, 2013 2:34 pm

Re: Batch conversion with Office AddIn by addressing Command

Post by koch000c »

Hello Stefan,

thanks for your quick reply. Unfortunately the code

Application.CommandBars.ExecuteMso("PDFXC4_CreatePDF")

produces the error message "Invalid procedure call or invalid argument". Any other suggestions?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Batch conversion with Office AddIn by addressing Command

Post by Tracker Supp-Stefan »

Hello koch000c,

Just to confirm - are you still using V4 of our standard printing drivers (and the respecitve Office add-in) or is it version 5?
If it's the latter - then the ID name would be different, but if you are at V4 I am afraid that we do not have any further ideas at this moment :(

Best,
Stefan
wolfgang_1234
User
Posts: 2
Joined: Wed Oct 23, 2013 8:34 am

Re: Batch conversion with Office AddIn by addressing Command

Post by wolfgang_1234 »

Good afternoon,

I do have exactly the same problem as the previous poster - has there been identified any solution yet?

I would like to execute a simple VBA code that converts all open word documents to PDFs with the settings as set with the ribbon button.

Thank you and kind regards
Wolfgang
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Batch conversion with Office AddIn by addressing Command

Post by Tracker Supp-Stefan »

Hi Wolfgang,

I am afraid that we don't have any VBA code samples for automating Word.

Doesn't the Office2PDF tool work correctly for you?

Regards,
Stefan
wolfgang_1234
User
Posts: 2
Joined: Wed Oct 23, 2013 8:34 am

Re: Batch conversion with Office AddIn by addressing Command

Post by wolfgang_1234 »

No, unfortunately it does not. The office2pdf tool does not create the bookmarks based on headlines - the autodetect feature is not suitable for the kind of headlines I use. I need to create the PDF with settings which are only available when created from within Word.

Kind regards
Wolfgang
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Batch conversion with Office AddIn by addressing Command

Post by Tracker Supp-Stefan »

Hi Wolfgang,

Sorry to hear that Office2PDF is not suitable and hope you will manage to get the scripts you need.

Regards,
Stefan
Post Reply