Using VBA Automation to Open Word at the File Open Locatiion 
Author Message
 Using VBA Automation to Open Word at the File Open Locatiion

I have been working on an application to merge documents in
Word from an Acces database.  I found a knowledge base
article   Q209976 about Merging that was helpful.  Now
rather than do the complete merge we would like instead to
stop with Word open and the File Open dialog box open to
the directory that contains the merge template documents.

What would the command sequence be to permit this.  I would
have to open word but the place to stop is a dialog box not
a document.

Any pointers for help would be appreciated. Is there a
resource that lists all possible commands? Thanks.

Michael



Fri, 28 Oct 2005 22:24:04 GMT  
 Using VBA Automation to Open Word at the File Open Locatiion
Hi Michael,

You can use something like

ChangeFileOpenDirectory Path:="C:\Temp"
Dialogs(wdDialogFileOpen).Show

or

With Dialogs(wdDialogFileOpen)
    .Name = "D:\Temp"
    .Show
End With

If you need a complete list of the arguments that the dialogs can use, then
have a look at the VBA help topic "Built-in dialog box argument lists".
Caveat utor: the argument list is incomplete and buggy. I use them sometimes
and have pretty good success with more common dialogs.

HTH


Quote:
> I have been working on an application to merge documents in
> Word from an Acces database.  I found a knowledge base
> article   Q209976 about Merging that was helpful.  Now
> rather than do the complete merge we would like instead to
> stop with Word open and the File Open dialog box open to
> the directory that contains the merge template documents.

> What would the command sequence be to permit this.  I would
> have to open word but the place to stop is a dialog box not
> a document.

> Any pointers for help would be appreciated. Is there a
> resource that lists all possible commands? Thanks.

> Michael



Fri, 28 Oct 2005 22:35:37 GMT  
 Using VBA Automation to Open Word at the File Open Locatiion
HTH
Thanks for the reply.

I quess I have to better understand how to start Word from
Access without a document to open.

Article Q209976 looks like these statements

Dim objword as Word.document
Set objword = GetObject ("c:\mymerge","Word.Document")
' Make Word visible
objword.Application.Visible = True

I am not opening a document.  How do I start Word.

Thanks.

Michael

Quote:
>-----Original Message-----
>Hi Michael,

>You can use something like

>ChangeFileOpenDirectory Path:="C:\Temp"
>Dialogs(wdDialogFileOpen).Show

>or

>With Dialogs(wdDialogFileOpen)
>    .Name = "D:\Temp"
>    .Show
>End With

>If you need a complete list of the arguments that the

dialogs can use, then

- Show quoted text -

Quote:
>have a look at the VBA help topic "Built-in dialog box
argument lists".
>Caveat utor: the argument list is incomplete and buggy. I
use them sometimes
>and have pretty good success with more common dialogs.

>HTH



>> I have been working on an application to merge documents in
>> Word from an Acces database.  I found a knowledge base
>> article   Q209976 about Merging that was helpful.  Now
>> rather than do the complete merge we would like instead to
>> stop with Word open and the File Open dialog box open to
>> the directory that contains the merge template documents.

>> What would the command sequence be to permit this.  I would
>> have to open word but the place to stop is a dialog box not
>> a document.

>> Any pointers for help would be appreciated. Is there a
>> resource that lists all possible commands? Thanks.

>> Michael

>.



Fri, 28 Oct 2005 23:36:24 GMT  
 Using VBA Automation to Open Word at the File Open Locatiion
Quote:
> I am not opening a document.  How do I start Word.

Once you start a Word document, Word as an application is
also running. An Office document can't run without it's
application host.
You can get a reference in yr code to Word (as an application)
by refering to the document's parent.

Look at below lines run from the Excel VBE immediate window
Last line will make Word (as an application) go visible.

set d = getobject("d:\MyDocs\Word\Temp\TempDoc 1.doc")
? d.parent.name
Microsoft Word
? d.fullname
D:\MyDocs\Word\Temp\TempDoc 1.doc
d.parent.visible = true

Krgrds,
Perry



Quote:
> HTH
> Thanks for the reply.

> I quess I have to better understand how to start Word from
> Access without a document to open.

> Article Q209976 looks like these statements

> Dim objword as Word.document
> ' Make Word visible
> objword.Application.Visible = True

> I am not opening a document.  How do I start Word.

> Thanks.

> Michael
> >-----Original Message-----
> >Hi Michael,

> >You can use something like

> >ChangeFileOpenDirectory Path:="C:\Temp"
> >Dialogs(wdDialogFileOpen).Show

> >or

> >With Dialogs(wdDialogFileOpen)
> >    .Name = "D:\Temp"
> >    .Show
> >End With

> >If you need a complete list of the arguments that the
> dialogs can use, then
> >have a look at the VBA help topic "Built-in dialog box
> argument lists".
> >Caveat utor: the argument list is incomplete and buggy. I
> use them sometimes
> >and have pretty good success with more common dialogs.

> >HTH



> >> I have been working on an application to merge documents in
> >> Word from an Acces database.  I found a knowledge base
> >> article   Q209976 about Merging that was helpful.  Now
> >> rather than do the complete merge we would like instead to
> >> stop with Word open and the File Open dialog box open to
> >> the directory that contains the merge template documents.

> >> What would the command sequence be to permit this.  I would
> >> have to open word but the place to stop is a dialog box not
> >> a document.

> >> Any pointers for help would be appreciated. Is there a
> >> resource that lists all possible commands? Thanks.

> >> Michael

> >.



Sat, 29 Oct 2005 05:45:23 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem Opening large HTML file in Word using VBA

2. Problem Opening large HTML file in Word using VBA

3. Opening a File Open window for file selection in VBA

4. Can't open word doc using automation

5. Open Word document using Automation

6. Word Automation Failure when other word documents are open

7. Open Word from Access Using VBA....

8. Word freezes trying to run macro or open vba using Alt-F11

9. Opening Word using Excel VBA

10. Opening embedded Word Doc in Powerpoint Slideshow using VBA

11. Opening files using automation.

12. Opening Word as a Text File from VBA

 

 
Powered by phpBB® Forum Software