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

Re: Routine to simulate keystrokes passing from keyboard by Word

Word
Thu Jun 23 22:16:43 CDT 2005

G'day "rtrsr" <rick@!nospam!carolinacourtroomlawyers>,

SendKeys

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


rtrsr reckoned:

>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
>


Re: Routine to simulate keystrokes passing from keyboard by rtrsr

rtrsr
Fri Jun 24 09:02:44 CDT 2005

Thanks!


"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:joumb1lr12bv4jrpv8040i2ebcfiq78tp4@4ax.com...
> G'day "rtrsr" <rick@!nospam!carolinacourtroomlawyers>,
>
> SendKeys
>
> Steve Hudson - Word Heretic
>
> steve from wordheretic.com (Email replies require payment)
> Without prejudice
>
>
> rtrsr reckoned:
>
>>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
>>
>