What line of code would I use in word to print a document directly to a PDF
without getting in information form the user. The variables that I would want
to set in code would be:
For the PDF to be saved in the same location as the original document.
I want to set the name of the PDF in code

The name of my PDF printer is: "Adobe PDF"

I just want to put a button on a word document that prints the current to a
PDF storing it in the same location as the original document and with a file
name that I set in code.

Thankyou in advance for your help.

Re: Print Directly To PDF by Jezebel

Jezebel
Thu Aug 18 02:45:01 CDT 2005

If you're using Acrobat 6 --

1. Add a reference to AdobePDFMaker to your VBA project.

2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF

The PDF will have the same name as the Word document, and be put in the same
folder. You can then rename it as you need. To make sure you get no prompts
from Acrobat, a) Make sure the Word document is saved, and b) check that
there is no existing PDF file that will get overwritten.




"Ben" <Ben@discussions.microsoft.com> wrote in message
news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
> What line of code would I use in word to print a document directly to a
> PDF
> without getting in information form the user. The variables that I would
> want
> to set in code would be:
> For the PDF to be saved in the same location as the original document.
> I want to set the name of the PDF in code
>
> The name of my PDF printer is: "Adobe PDF"
>
> I just want to put a button on a word document that prints the current to
> a
> PDF storing it in the same location as the original document and with a
> file
> name that I set in code.
>
> Thankyou in advance for your help.



Re: Print Directly To PDF by David

David
Thu Aug 18 08:40:05 CDT 2005

Where can I find more documentation on the AdobePDFMaker object with its
properties & methods?

Jezebel wrote:
> If you're using Acrobat 6 --
>
> 1. Add a reference to AdobePDFMaker to your VBA project.
>
> 2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
>
> The PDF will have the same name as the Word document, and be put in the same
> folder. You can then rename it as you need. To make sure you get no prompts
> from Acrobat, a) Make sure the Word document is saved, and b) check that
> there is no existing PDF file that will get overwritten.
>
>
>
>
> "Ben" <Ben@discussions.microsoft.com> wrote in message
> news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
>
>>What line of code would I use in word to print a document directly to a
>>PDF
>>without getting in information form the user. The variables that I would
>>want
>>to set in code would be:
>>For the PDF to be saved in the same location as the original document.
>>I want to set the name of the PDF in code
>>
>>The name of my PDF printer is: "Adobe PDF"
>>
>>I just want to put a button on a word document that prints the current to
>>a
>>PDF storing it in the same location as the original document and with a
>>file
>>name that I set in code.
>>
>>Thankyou in advance for your help.
>
>
>

Re: Print Directly To PDF by Ben

Ben
Thu Aug 18 20:08:03 CDT 2005

I tried that but it still pops up with the save as dialog for the pdf. I did
exactly what you said added the reference and then used the line:
AdobePDFMaker.ConvertToGelatoPDF

Before I was using the below:

ActivePrinter = "Adobe PDF"
Application.PrintOut

this essentially does the same as you suggested but it does not require the
reference. I just need to be able to convert it to pdf without any use
interaction whilst giving it a name and setting the location for it to
stored. It storing it in the same location as the original document and using
the same name would do fine.

Thank you again.

"Jezebel" wrote:

> If you're using Acrobat 6 --
>
> 1. Add a reference to AdobePDFMaker to your VBA project.
>
> 2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
>
> The PDF will have the same name as the Word document, and be put in the same
> folder. You can then rename it as you need. To make sure you get no prompts
> from Acrobat, a) Make sure the Word document is saved, and b) check that
> there is no existing PDF file that will get overwritten.
>
>
>
>
> "Ben" <Ben@discussions.microsoft.com> wrote in message
> news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
> > What line of code would I use in word to print a document directly to a
> > PDF
> > without getting in information form the user. The variables that I would
> > want
> > to set in code would be:
> > For the PDF to be saved in the same location as the original document.
> > I want to set the name of the PDF in code
> >
> > The name of my PDF printer is: "Adobe PDF"
> >
> > I just want to put a button on a word document that prints the current to
> > a
> > PDF storing it in the same location as the original document and with a
> > file
> > name that I set in code.
> >
> > Thankyou in advance for your help.
>
>
>

Re: Print Directly To PDF by Jezebel

Jezebel
Fri Aug 19 08:03:05 CDT 2005

You'll get a prompt if the word document has never been saved -- apart from
that, don't know. The method works for me. But it's all undocumented, so
anybody's guess.




"Ben" <Ben@discussions.microsoft.com> wrote in message
news:2E0E71E2-B59B-4DBA-BAD3-C6A6022D5DF6@microsoft.com...
>I tried that but it still pops up with the save as dialog for the pdf. I
>did
> exactly what you said added the reference and then used the line:
> AdobePDFMaker.ConvertToGelatoPDF
>
> Before I was using the below:
>
> ActivePrinter = "Adobe PDF"
> Application.PrintOut
>
> this essentially does the same as you suggested but it does not require
> the
> reference. I just need to be able to convert it to pdf without any use
> interaction whilst giving it a name and setting the location for it to
> stored. It storing it in the same location as the original document and
> using
> the same name would do fine.
>
> Thank you again.
>
> "Jezebel" wrote:
>
>> If you're using Acrobat 6 --
>>
>> 1. Add a reference to AdobePDFMaker to your VBA project.
>>
>> 2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
>>
>> The PDF will have the same name as the Word document, and be put in the
>> same
>> folder. You can then rename it as you need. To make sure you get no
>> prompts
>> from Acrobat, a) Make sure the Word document is saved, and b) check that
>> there is no existing PDF file that will get overwritten.
>>
>>
>>
>>
>> "Ben" <Ben@discussions.microsoft.com> wrote in message
>> news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
>> > What line of code would I use in word to print a document directly to a
>> > PDF
>> > without getting in information form the user. The variables that I
>> > would
>> > want
>> > to set in code would be:
>> > For the PDF to be saved in the same location as the original document.
>> > I want to set the name of the PDF in code
>> >
>> > The name of my PDF printer is: "Adobe PDF"
>> >
>> > I just want to put a button on a word document that prints the current
>> > to
>> > a
>> > PDF storing it in the same location as the original document and with a
>> > file
>> > name that I set in code.
>> >
>> > Thankyou in advance for your help.
>>
>>
>>
>



Re: Print Directly To PDF by Jezebel

Jezebel
Fri Aug 19 08:06:16 CDT 2005

There's no free source of documentation that I know of. You can see the
methods of the object by using Tools > Macros and selecting PDFMaker from
the 'Macros in' dialog. Then experiment :)

Earlier versions of Acrobat had an SDK that you could download for free.
That provided some documentation, some of which is still relevant. But with
Acrobat 6 the SDK is no longer free, and I'm too stingy to pay for it. And
in any case, they're now up to version 7, which is a different kettle of
fish entirely.





"David C. Holley" <DavidCHolley@netscape.net> wrote in message
news:e97TZp$oFHA.3656@TK2MSFTNGP09.phx.gbl...
> Where can I find more documentation on the AdobePDFMaker object with its
> properties & methods?
>
> Jezebel wrote:
>> If you're using Acrobat 6 --
>>
>> 1. Add a reference to AdobePDFMaker to your VBA project.
>>
>> 2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
>>
>> The PDF will have the same name as the Word document, and be put in the
>> same folder. You can then rename it as you need. To make sure you get no
>> prompts from Acrobat, a) Make sure the Word document is saved, and b)
>> check that there is no existing PDF file that will get overwritten.
>>
>>
>>
>>
>> "Ben" <Ben@discussions.microsoft.com> wrote in message
>> news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
>>
>>>What line of code would I use in word to print a document directly to a
>>>PDF
>>>without getting in information form the user. The variables that I would
>>>want
>>>to set in code would be:
>>>For the PDF to be saved in the same location as the original document.
>>>I want to set the name of the PDF in code
>>>
>>>The name of my PDF printer is: "Adobe PDF"
>>>
>>>I just want to put a button on a word document that prints the current to
>>>a
>>>PDF storing it in the same location as the original document and with a
>>>file
>>>name that I set in code.
>>>
>>>Thankyou in advance for your help.
>>
>>


Re: Print Directly To PDF by David

David
Fri Aug 19 16:32:04 CDT 2005

Just curious becase the question came up a bit ago in the Access
newsgroup and the responses (including mine) dealt with printing to the
designated PDF printer.

Jezebel wrote:
> There's no free source of documentation that I know of. You can see the
> methods of the object by using Tools > Macros and selecting PDFMaker from
> the 'Macros in' dialog. Then experiment :)
>
> Earlier versions of Acrobat had an SDK that you could download for free.
> That provided some documentation, some of which is still relevant. But with
> Acrobat 6 the SDK is no longer free, and I'm too stingy to pay for it. And
> in any case, they're now up to version 7, which is a different kettle of
> fish entirely.
>
>
>
>
>
> "David C. Holley" <DavidCHolley@netscape.net> wrote in message
> news:e97TZp$oFHA.3656@TK2MSFTNGP09.phx.gbl...
>
>>Where can I find more documentation on the AdobePDFMaker object with its
>>properties & methods?
>>
>>Jezebel wrote:
>>
>>>If you're using Acrobat 6 --
>>>
>>>1. Add a reference to AdobePDFMaker to your VBA project.
>>>
>>>2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
>>>
>>>The PDF will have the same name as the Word document, and be put in the
>>>same folder. You can then rename it as you need. To make sure you get no
>>>prompts from Acrobat, a) Make sure the Word document is saved, and b)
>>>check that there is no existing PDF file that will get overwritten.
>>>
>>>
>>>
>>>
>>>"Ben" <Ben@discussions.microsoft.com> wrote in message
>>>news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
>>>
>>>
>>>>What line of code would I use in word to print a document directly to a
>>>>PDF
>>>>without getting in information form the user. The variables that I would
>>>>want
>>>>to set in code would be:
>>>>For the PDF to be saved in the same location as the original document.
>>>>I want to set the name of the PDF in code
>>>>
>>>>The name of my PDF printer is: "Adobe PDF"
>>>>
>>>>I just want to put a button on a word document that prints the current to
>>>>a
>>>>PDF storing it in the same location as the original document and with a
>>>>file
>>>>name that I set in code.
>>>>
>>>>Thankyou in advance for your help.
>>>
>>>
>

Re: Print Directly To PDF by Ben

Ben
Mon Aug 29 23:59:01 CDT 2005

Now that I have create the doucment that I wanted to and I have started to
let other people use it. I am now finding that some people machines can not
find the referance to: AdobePDFMaker

They have the excat same version and installation of Adobe Acrobat Distiller
6.0. When I go in to add the referance on their computer the AdobePDFMaker
does not come up on the list. How can I force the computer to find the
referance? DO you know where it is located on the C drive so I can add it
manually?

They all seem to have: AdobePDFMakerX but I cannot get the same functions to
work.

Thankyou in advance for your help.

"Jezebel" wrote:

> You'll get a prompt if the word document has never been saved -- apart from
> that, don't know. The method works for me. But it's all undocumented, so
> anybody's guess.
>
>
>
>
> "Ben" <Ben@discussions.microsoft.com> wrote in message
> news:2E0E71E2-B59B-4DBA-BAD3-C6A6022D5DF6@microsoft.com...
> >I tried that but it still pops up with the save as dialog for the pdf. I
> >did
> > exactly what you said added the reference and then used the line:
> > AdobePDFMaker.ConvertToGelatoPDF
> >
> > Before I was using the below:
> >
> > ActivePrinter = "Adobe PDF"
> > Application.PrintOut
> >
> > this essentially does the same as you suggested but it does not require
> > the
> > reference. I just need to be able to convert it to pdf without any use
> > interaction whilst giving it a name and setting the location for it to
> > stored. It storing it in the same location as the original document and
> > using
> > the same name would do fine.
> >
> > Thank you again.
> >
> > "Jezebel" wrote:
> >
> >> If you're using Acrobat 6 --
> >>
> >> 1. Add a reference to AdobePDFMaker to your VBA project.
> >>
> >> 2. Use the instruction: AdobePDFMaker.ConvertToGelatoPDF
> >>
> >> The PDF will have the same name as the Word document, and be put in the
> >> same
> >> folder. You can then rename it as you need. To make sure you get no
> >> prompts
> >> from Acrobat, a) Make sure the Word document is saved, and b) check that
> >> there is no existing PDF file that will get overwritten.
> >>
> >>
> >>
> >>
> >> "Ben" <Ben@discussions.microsoft.com> wrote in message
> >> news:38251410-BE0A-464A-BC03-BC0D2A8A4430@microsoft.com...
> >> > What line of code would I use in word to print a document directly to a
> >> > PDF
> >> > without getting in information form the user. The variables that I
> >> > would
> >> > want
> >> > to set in code would be:
> >> > For the PDF to be saved in the same location as the original document.
> >> > I want to set the name of the PDF in code
> >> >
> >> > The name of my PDF printer is: "Adobe PDF"
> >> >
> >> > I just want to put a button on a word document that prints the current
> >> > to
> >> > a
> >> > PDF storing it in the same location as the original document and with a
> >> > file
> >> > name that I set in code.
> >> >
> >> > Thankyou in advance for your help.
> >>
> >>
> >>
> >
>
>
>