[comp.windows.ms] WfW Macro FileOpen Convertion confirmation

cids05@vaxa.strath.ac.uk (@Dr Stephen K Tagg@) (03/13/91)

This is addressed to any Word for Windows Macro experts in the net

I have the boring task of converting all the .RFT files on a floppy to 
MAC Word format. (some of our staff are moving from system/36 to MACs)
so I have attempted to write a macro to automate this.

The only problem is the FileOpen command
when I get it to open the next file on the list correctly it insists
on bringing up a dialogue box in which I have to reply OK to confirm that
I want the file converted from .RFT format.

I tried SendKeys and OK after the FileOpen statement but they had no effect.

I am on WfW 1.1 but I presume my Technical Reference is for 1.0 (typical
publishers insisted it was the latest version here in the UK in the last month)

ANY ideas?

Stephen Tagg
Lecturer in Marketing
University of Strathclyde
GLASGOW, SCOTLAND

gg2@cunixf.cc.columbia.edu (Guy Gallo) (03/17/91)

In article <1991Mar12.164620.10454@vaxa.strath.ac.uk> cids05@vaxa.strath.ac.uk (@Dr Stephen K Tagg@) writes:
>This is addressed to any Word for Windows Macro experts in the net
>
>I have the boring task of converting all the .RFT files on a floppy to 
>MAC Word format. (some of our staff are moving from system/36 to MACs)
>so I have attempted to write a macro to automate this.
>
>The only problem is the FileOpen command
>when I get it to open the next file on the list correctly it insists
>on bringing up a dialogue box in which I have to reply OK to confirm that
>I want the file converted from .RFT format.
>
>I tried SendKeys and OK after the FileOpen statement but they had no effect.
>

Try placing the SendKeys statement *Before* FileOpen.

SendKeys places a keys sequence in the buffer, and those keys act AFTER
the next dialog box/command.

So, if you have RFT (or is that RTF) associated with the proper conversion
DLL in your Win.ini, then opening a file of that extension will automatically
place the selection on the correct conversion during the conversion dialog
box/confirmation.  All you have to do is send a carriage return:

Dim dlg As FileOpen
dlg.Name = "*.RTF"
dialog dlg
SendKeys "{Enter}"
FileOpen dlg.Name

Would show you a fileOpen dialog box with just RTF files, and then auto-
matically convert it.

myoung@rm1.UUCP (Michael Young) (03/21/91)

In article <1991Mar12.164620.10454@vaxa.strath.ac.uk>, cids05@vaxa.strath.ac.uk (@Dr Stephen K Tagg@) writes:

>The only problem is the FileOpen command
>when I get it to open the next file on the list correctly it insists
>on bringing up a dialogue box in which I have to reply OK to confirm that
>I want the file converted from .RFT format.
>
>I tried SendKeys and OK after the FileOpen statement but they had no effect.
>
>I am on WfW 1.1 but I presume my Technical Reference is for 1.0 (typical
>publishers insisted it was the latest version here in the UK in the last month)
> 
>ANY ideas?

I believe your problem is you issued the SendKeys AFTER the FileOpen.  You need
to issue it BEFORE FileOpen.  It will stuff the codes in the buffer and return
to execute the FileOpen command.  When FileOpen runs and puts up the dialog
box it will get the "{enter}" string you issued via SendKeys.  Be sure that
you're using the "{enter}" mnemonic also.

This should work.  I have done it myself for another similar macro.

> 
>Stephen Tagg
>Lecturer in Marketing
>University of Strathclyde
>GLASGOW, SCOTLAND

-- 
Mike Young

--------------------------------------------------------------------------
Racal-Milgo
1601 N. Harrison Parkway	Phone:	(305) 846-6956
Sunrise, FL  33323-2899  	UUCP:	...uflorida!novavax!rm1!myoung
--------------------------------------------------------------------------