
Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Hallo Helmut,
Danke for your answer. ;-)
And my answer to your question would be : I've tried, and nothing
worked. But maybe I don't write my command line right. I have tried :
1- "...\WINWORD.EXE" /t"...\myModel.dot"/mMyMacro,
2- "...\WINWORD.EXE" /mMyMacro /t"...\myModel.dot"
3- "...\WINWORD.EXE" /mMyMacro/t"...\myModel.dot"
4- "...\WINWORD.EXE" "...\myModel.dot"/mMyMacro
Nothing seems to work....
The thing that is killing me is that my AutoOpen macro and my
Document_New procedure are launched correctly when I open myModel.dot
directly from the explorer. But when I try with the command line, it
doesn't.
I have looked at the command line used by Windows to open a .DOT file
(Explorer-Tools-Folder options). Apparently, it uses some DDE interface
(DDE message used : [REM_DDE_Direct][FileNew("%1")]), but I don't know
how to use this interface in my command line... And I can't find
anything about this on the Internet.
So if someone has a tip for me... Thanks again.
Greetings from Paris, France.
Helmut Weber a écrit :
> Hi,
> have you tried the switch
[quoted text clipped - 4 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Helmut Weber - 10 Oct 2006 16:38 GMT
Hi,
as seemably nobody else knows better ;-)
i've often encountered problems with automacros.
It seems to be a matter of timing
and of the sequence in which dots are loaded.
The following works for me:
winword /tc:\edit2003\co-english.dot
Of course, cmd is in the appropriate directy already.
Creates a new doc from the template "co-english.dot".
In normal.dot:
Sub AutoExec()
' not working with autonew, it seems
' wait 6 seconds
Application.OnTime When:=Now + TimeValue("00:00:06"), _
Name:="AutoNewtest"
End Sub
In the template "co-english.dot"
Sub AutoNewtest()
MsgBox "Autonewtest from co-english.dot"
End Sub

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"