AutoNew fails to execute from command line 
Author Message
 AutoNew fails to execute from command line

Hello Everyone,

I am starting Word2000 via this VBS from Outlook2000:

Sub btnFax_click
 Set WSHShell = CreateObject("Wscript.Shell")
 WshShell.Run "winword.exe /tu:\documents\templates\test.dot"
 Set wshShell = nothing
End Sub

The script executes Word and loads the template accordingly. However the
AutoNew event never fires. Neither does AutoOpen. It doesn't work from a
command line either.

These two events should fire even though Word is called from another app?

Regards,

Kurt

--
_________________________________________________________
Kurt Jones, Manager (Australia) - PULNiX Sensors Inc.
Office:+61 3 9546 0533 | Direct:+61 3 9582 6712
Mobile: 0414 248 828 | Fax:+61 3 9547 9450



Sun, 10 Nov 2002 03:00:00 GMT  
 AutoNew fails to execute from command line
Hi Kurt,

Quote:
> WshShell.Run "winword.exe /tu:\documents\templates\test.dot"

> The script executes Word and loads the template accordingly. However the
> AutoNew event never fires. Neither does AutoOpen. It doesn't work from a
> command line either.

That is correct. AutoNew macros and the New event are not fired when you
create a new document using the /t switch from a commmand line. This is
documented in KB article Q181783. The solution they give there is to OPEN
the template and run a macro that creates a new document from the
template.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sun, 10 Nov 2002 03:00:00 GMT  
 AutoNew fails to execute from command line
Thanks Cindy,

This KB article refers to Word97. Do you know if the problem still exists in
Word2000?

Thanks,

Kurt



Quote:
> Hi Kurt,

> > WshShell.Run "winword.exe /tu:\documents\templates\test.dot"

> > The script executes Word and loads the template accordingly. However the
> > AutoNew event never fires. Neither does AutoOpen. It doesn't work from a
> > command line either.

> That is correct. AutoNew macros and the New event are not fired when you
> create a new document using the /t switch from a commmand line. This is
> documented in KB article Q181783. The solution they give there is to OPEN
> the template and run a macro that creates a new document from the
> template.

> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister
> http://go.compuserve.com/MSOfficeForum

> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)



Mon, 11 Nov 2002 03:00:00 GMT  
 AutoNew fails to execute from command line
Hi Kurt,

Quote:
> Do you know if the problem still exists in
> Word2000?

In my experience, yes, it does.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Mon, 11 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to execute a command line command from a *.HTA

2. Executing command to command line from VB App

3. Oracle and ADO command.execute- Create Trigger Fails

4. Command.Execute with parameter works with ODBC provider, fails with Microsoft.Jet.OLEDB.4.0

5. Word VBA AutoNew macros fail to start

6. Command Line Compilation fails for OCX

7. Command-line make fails when linking (VB6)

8. Executing a command line using code

9. Executing command line function from VBA (Excel)

10. VBA script - execute from command line

11. Executing command-line EXE and retrieving output

12. How do you execute a Command line App inside a VB program

 

 
Powered by phpBB® Forum Software