Passing data using VBA in Word to an standalone VB app on the same machine 
Author Message
 Passing data using VBA in Word to an standalone VB app on the same machine

Hello everyone,

I have a question for you.  I'm looking for a relatively simple, reliable
way to accomplish the following task:

1. Users launch a standalone VB app that is basically a data entry form.
2. Users would then launch Word and open a relevant document.
3. Users would select a string in the Word document, then right click and
select a destination.   I have a context menu in Word that has several 'send
to>destination' options.   Each destination in the context menu represents
an individual text box control on the standalone VB data entry form.
4. I would like to pass the selected text from Word to the corresponding
text box on the VB form.  Is there a way to do this through memory mapping?
Is there a fairly straightforward approach that I could try?

Thanks in advance

Joe



Wed, 02 Oct 2002 03:00:00 GMT  
 Passing data using VBA in Word to an standalone VB app on the same machine
This is a little trick you can use only if the data isn't to large:

GetSetting() and SaveSettings()

these are registry calls, if you use the same path with a different
stringname, it should work.

JD


Quote:
> Hello everyone,

> I have a question for you.  I'm looking for a relatively simple, reliable
> way to accomplish the following task:

> 1. Users launch a standalone VB app that is basically a data entry form.
> 2. Users would then launch Word and open a relevant document.
> 3. Users would select a string in the Word document, then right click and
> select a destination.   I have a context menu in Word that has several
'send
> to>destination' options.   Each destination in the context menu represents
> an individual text box control on the standalone VB data entry form.
> 4. I would like to pass the selected text from Word to the corresponding
> text box on the VB form.  Is there a way to do this through memory
mapping?
> Is there a fairly straightforward approach that I could try?

> Thanks in advance

> Joe



Wed, 02 Oct 2002 03:00:00 GMT  
 Passing data using VBA in Word to an standalone VB app on the same machine
Hi Joe,

You could use a memory mapped file, and either read from the MM file using
copymemory or insert the string length in the four bytes before each string
and change your string's pointers to point to the first character.  Doing
this means that only one instance of the data exists.  Note: you would
probably have to use a named MM file (see PlatformSDK for more details)
If your data set is not large, then it probably isn't worth going to the
effort of using a MM file.  Another alternative is to send your VB a message
(WM_COPYDATA I think).
See www.mvps.org/vb Karl has samples of MM file, and  I think there is one
to do with App.PrevInst there that shows how to send data using sendmessage
api.
You could also look at using DDE or make your app an activeX EXE.

Bill.


Quote:
> Hello everyone,

> I have a question for you.  I'm looking for a relatively simple, reliable
> way to accomplish the following task:

> 1. Users launch a standalone VB app that is basically a data entry form.
> 2. Users would then launch Word and open a relevant document.
> 3. Users would select a string in the Word document, then right click and
> select a destination.   I have a context menu in Word that has several
'send
> to>destination' options.   Each destination in the context menu represents
> an individual text box control on the standalone VB data entry form.
> 4. I would like to pass the selected text from Word to the corresponding
> text box on the VB form.  Is there a way to do this through memory
mapping?
> Is there a fairly straightforward approach that I could try?

> Thanks in advance

> Joe



Thu, 03 Oct 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing data using VBA in Word to an standalone VB app on the same machine

2. Passing structures from C++ app to a VB client app through Network connection using COM

3. Printing from VB using MS Word 2000 on multiprocessor machine

4. word vba hanging when passing from browser to word

5. Retrieving Access OLE Object data from Word VBA using DAO

6. App in VB5 using Access97 incompatible with machine using Access 2000

7. App in VB5 using Access97 incompatible with machine using Access 2000

8. vba and bookmarks, passing data from vba to a document

9. DAO standalone app to ADO web-based app?

10. Passing Data from VB App Text Box to a Web Page Text Box

11. Easy way to convert web based ASP app to standalone app

12. can my VB app pass data to the web browser control?...how to

 

 
Powered by phpBB® Forum Software