473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Open new instance of Word from mdb.

Hi! I need help opening a Word document from within an Access 2000/XP
mdb. I'm using Shell to open the document, but the Access code
continues to run past the Shell statement.

What I need is the ability to stop the code from executing until the
Word doc is closed. Additionally, I need the ability for a new instance
of Word to be created instead of opening the doc an instance of Word
that may already be open.

If you have any thoughts on this, I'd love to hear from you!! I've been
pulling my hair out on this one!

TIA,

DaveS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
4 2406
On 04 Aug 2004 13:55:01 GMT, DaveS <an*******@devdex.com> wrote:

Put a Stop instruction after the Shell line :-)

What you want to do is called Automation. It all starts with
CreateObject("Word.Application"). There are MANY resources on the
Internet, including this one:
http://www.mvps.org/access/modules/mdl0006.htm

Also note: perform a FULL installation of Word, so you will get the
help file that documents Word's object model.

-Tom.
Hi! I need help opening a Word document from within an Access 2000/XP
mdb. I'm using Shell to open the document, but the Access code
continues to run past the Shell statement.

What I need is the ability to stop the code from executing until the
Word doc is closed. Additionally, I need the ability for a new instance
of Word to be created instead of opening the doc an instance of Word
that may already be open.

If you have any thoughts on this, I'd love to hear from you!! I've been
pulling my hair out on this one!

TIA,

DaveS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #2
On 04 Aug 2004 13:55:01 GMT, DaveS <an*******@devdex.com> wrote:
Hi! I need help opening a Word document from within an Access 2000/XP
mdb. I'm using Shell to open the document, but the Access code
continues to run past the Shell statement.

What I need is the ability to stop the code from executing until the
Word doc is closed. Additionally, I need the ability for a new instance
of Word to be created instead of opening the doc an instance of Word
that may already be open.

If you have any thoughts on this, I'd love to hear from you!! I've been
pulling my hair out on this one!


In addition to what Tom has posted, look at this for waiting the
Access application:

http://www.mvps.org/access/api/api0004.htm

paul

Nov 13 '05 #3
Thanks, Paul!

Now what I need is a method of creating a NEW instance of Word every
time a doc is opened instead of opening the doc into Word if it's
already open.

Shelling out to Word seems to open Word only if it's not already open.
If it is already open, it opens the document in the currently open
instance of Word.

---------------------------
Unfortunately, OLE Automation does not seem to be the answer here,
either...

TIA,

DaveS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4
On 04 Aug 2004 19:24:51 GMT, DaveS <an*******@devdex.com> wrote:
Thanks, Paul!

Now what I need is a method of creating a NEW instance of Word every
time a doc is opened instead of opening the doc into Word if it's
already open.

Shelling out to Word seems to open Word only if it's not already open.
If it is already open, it opens the document in the currently open
instance of Word.


I suspect that the line:

..dwFlags = STARTF_USESHOWWINDOW

needs to be modified to reflect that the process must be opened in a
new window, rather than in an already existing one.

I don't know enough about the API being called to confidently identify
how to modify it, though. A little googling turned up this page,
though:

http://www.mentalis.org/apilist/CreateProcess.shtml

which might be helpful. It seems to indicate that if you set the:

CREATE_NEW_CONSOLE flag is might work.

Maybe somebody who is familiar with the API in question can indicate
whether this is close.

ringo
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Robert Ferrell | last post by:
I have a question about assigning __call__ to an instance to make that instance callable. I know there has been quite a bit of discussion about this, and I've read all I can find, but I'm still...
3
by: Andy Davis | last post by:
How do i or can I open a word document directly from Access? I would like to be able for the user to click a button on my form to open a word document and then also run a macro in Word. Thanks...
8
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName =...
2
by: Todd | last post by:
Ok, this code works fine on the Web server machine. But when I try to run it via any other clients on the LAN, I keep getting scripting errors (the MS Word Document never opens.) Do I have to...
5
by: jpr | last post by:
Hello, I have a form with a cbo which get's its data from a table. This combo returns names of MS Word files in the following path: C:\shares\files\*.dot I would like to open these files...
2
by: Alan T | last post by:
In my C# application, I want to open a Word document using the code from the Help: using Microsoft.Office.Interop.Word; object readOnly = true; object fileName = @"C:\Test\NewDocument.doc"; ...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
0
by: RKovach | last post by:
I am automating Word and getting the existing instance if available using the following: Word.Application oWord = null; Word.Document oDoc = null; object oMissing =...
7
by: Peter | last post by:
I have the following code which is executed from a modal web page - it works fine on most, but on some computers the Word loads into memory but never displays. This occurs with IE6 and IE7, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.