Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Automating creation of a PDF document from Word via VBA
Is there a VBA routine that would allow me to pass keystrokes into an active
document -- as if they had been entered by a user? I'm trying to create a routine that creates (automatically) a PDF copy of the currently active document. The goal is to produce a PDF image of the active document that (1) bears the filename of the active document (without the ".doc", of course) and (2) is written in the currently active document's folder - just by having the user invoke a hotkey or press a custom button on the button bar. My problem is getting VBA to pass the current document's name into the PDF-creation system's dialog box. I can't find a PDF creation system (at least one that I can afford) that will let me pass the document name to it as an argument. So I propose to "brute force" around this by simply sending the same keystrokes a user would type into the dialog box as if they were generated from the keyboard. I know. This is old-fashioned DOS macro programming.... I'll let you laugh at me if you can tell me how to get VBA to do the same thing [grin]! Rick |
#2
|
|||
|
|||
rtrsr shared this with us in microsoft.public.word.docmanagement:
I can't find a PDF creation system (at least one that I can afford) There you have it. I believe this /should/ be possible (not sure, didn't try it) with the full Adobe Acrobat. It installs some macros, and I would be surprised if those macros couldn't be used in some way. -- Amedee Van Gasse |
#3
|
|||
|
|||
The Adobe macros are not accessible for editing and will always prompt for
the filename (while offering the original document name) I see no way to by-pass that without access to the Adobe code. Printing to the Adobe driver *may* be possible but my attempts to introduce the filename in vba code still results in a stop at the filename screen. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Amedee Van Gasse wrote: rtrsr shared this with us in microsoft.public.word.docmanagement: I can't find a PDF creation system (at least one that I can afford) There you have it. I believe this /should/ be possible (not sure, didn't try it) with the full Adobe Acrobat. It installs some macros, and I would be surprised if those macros couldn't be used in some way. |
#4
|
|||
|
|||
Graham Mayor shared this with us in microsoft.public.word.docmanagement:
The Adobe macros are not accessible for editing and will always prompt for the filename (while offering the original document name) I see no way to by-pass that without access to the Adobe code. Printing to the Adobe driver *may* be possible but my attempts to introduce the filename in vba code still results in a stop at the filename screen. I *am* surprised. I cannot imagine that such a thing hasn't been done already, somewhere out there in the real world. -- Amedee Van Gasse |
#5
|
|||
|
|||
Amedee,
I posted a related inquiry over in the VBA-General Newsgroup. My idea there was to brute-force a solution by passing the keystrokes for the document name straight into the PDF-Creating dialog box - sorta like we used to do with the "original" macros back in the Days of DOS. I got a one-word response from "Steve Hudson - Word Heretic": ========= SendKeys ========= OK, I've looked this up on http://msdn.microsoft.com/library/?u...thsendkeys.asp and, at first blush, this looks like a hopeful solution. Do you have any experience with this? If it won't work, I'd sure like to know it before I waste time hammering away. Rick Rodgers "Amedee Van Gasse" wrote in message ... Graham Mayor shared this with us in microsoft.public.word.docmanagement: The Adobe macros are not accessible for editing and will always prompt for the filename (while offering the original document name) I see no way to by-pass that without access to the Adobe code. Printing to the Adobe driver *may* be possible but my attempts to introduce the filename in vba code still results in a stop at the filename screen. I *am* surprised. I cannot imagine that such a thing hasn't been done already, somewhere out there in the real world. -- Amedee Van Gasse |
#6
|
|||
|
|||
Graham,
I posted a related inquiry over in the VBA-General Newsgroup. My idea there was to brute-force a solution by passing the keystrokes for the document name straight into the PDF-Creating dialog box - sorta like we used to do with the "original" macros back in the Days of DOS. I got a one-word response from "Steve Hudson - Word Heretic": ========= SendKeys ========= OK, I've looked this up on http://msdn.microsoft.com/library/?u...thsendkeys.asp and, at first blush, this looks like a hopeful solution. Do you have any experience with this? If it won't work, I'd sure like to know it before I waste time hammering away. Rick Rodgers "Graham Mayor" wrote in message ... The Adobe macros are not accessible for editing and will always prompt for the filename (while offering the original document name) I see no way to by-pass that without access to the Adobe code. Printing to the Adobe driver *may* be possible but my attempts to introduce the filename in vba code still results in a stop at the filename screen. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Amedee Van Gasse wrote: rtrsr shared this with us in microsoft.public.word.docmanagement: I can't find a PDF creation system (at least one that I can afford) There you have it. I believe this /should/ be possible (not sure, didn't try it) with the full Adobe Acrobat. It installs some macros, and I would be surprised if those macros couldn't be used in some way. |
#7
|
|||
|
|||
Steve's responses can sometimes be a bit cryptic - ask if he would
elaborate. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org rtrsr wrote: Graham, I posted a related inquiry over in the VBA-General Newsgroup. My idea there was to brute-force a solution by passing the keystrokes for the document name straight into the PDF-Creating dialog box - sorta like we used to do with the "original" macros back in the Days of DOS. I got a one-word response from "Steve Hudson - Word Heretic": ========= SendKeys ========= OK, I've looked this up on http://msdn.microsoft.com/library/?u...thsendkeys.asp and, at first blush, this looks like a hopeful solution. Do you have any experience with this? If it won't work, I'd sure like to know it before I waste time hammering away. Rick Rodgers "Graham Mayor" wrote in message ... The Adobe macros are not accessible for editing and will always prompt for the filename (while offering the original document name) I see no way to by-pass that without access to the Adobe code. Printing to the Adobe driver *may* be possible but my attempts to introduce the filename in vba code still results in a stop at the filename screen. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Amedee Van Gasse wrote: rtrsr shared this with us in microsoft.public.word.docmanagement: I can't find a PDF creation system (at least one that I can afford) There you have it. I believe this /should/ be possible (not sure, didn't try it) with the full Adobe Acrobat. It installs some macros, and I would be surprised if those macros couldn't be used in some way. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please give us REVEAL CODES like WORD PERFECT not reveal codes in. | Microsoft Word Help | |||
Word 2003 | Microsoft Word Help | |||
Macros - Keyboard Commands | Microsoft Word Help | |||
Locking Two Words Together to Make a Proper Compound Noun in Word | Microsoft Word Help | |||
Boiletplates from Word Perfect | Microsoft Word Help |