Results 1 to 2 of 2
Thread: AutoExec Conditional (Word VBA)
2007-11-28, 17:52 #1
- Join Date
- Jan 2001
- New York
- Thanked 0 Times in 0 Posts
AutoExec Conditional (Word VBA)
I have a startup Add-in.
It has an AutoExec function to display a form if a particular setting is true in the registry.
I would like to make this conditional on how Word was loaded. If loaded by double clicking a document in Explorer or a document in the Start Documents list (that is, if Word is loaded WITH a document) I want to abort the AutoExec. If Word is opened normally, I want to check whether or not to display the form.
Any way to grab the command line from VBA?
What's happening now (in Word 2003) is that loading with a Document does NOT load the document but runs AutoExec and stops.
2007-11-28, 18:09 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: AutoExec Conditional (Word VBA)
The command line doesn't seem to be exposed in the Word object model. You may be able to use code like this:
If Documents.Count = 1 Then
If InStr(ActiveDocument.FullName, "") = 0 Then
' Only blank new document open, so Word wasn't started by double clicking a doc