Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Navigate out of embedded object to a specific formfield

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen Clark - 30 Nov 2004 19:55 GMT
I am developing a Word 2000 form that contains three
embedded Objects (Word Docs) displayed as icons. The user
will double-click one or more of the icons to launch the
embedded Word docs. When the user has completed filling
out the form fields in the embedded document, he will save
and close, and will be returned to the main document, to
continue completing the form fields there.

The document is divided into sections. The area where the
object icons are located is unprotected, so the user can
double-click to launch the objects. The rest of the
document is protected for form fields.

Everything works great! Except for one minor detail...

After the user saves and closes the embedded doc, he is
returned to the main doc -- but the object icon is still
selected. Should the user press <Tab> at this point, the
object icon is deleted.

It would be idea if, when the user closes the embedded
doc, his cursor would be located in the next formfield.

I am VERY new at writing VB code. Can anyone help me write
a procedure that would run on exit in each of these three
embedded docs that would direct the user's cursor to a
specific formfield in the main document?

Thank you thank you thank you...
Karen Clark
Jean-Guy Marcil - 01 Dec 2004 01:01 GMT
Karen Clark was telling us:
Karen Clark nous racontait que :

> I am developing a Word 2000 form that contains three
> embedded Objects (Word Docs) displayed as icons. The user
[quoted text clipped - 23 lines]
> embedded docs that would direct the user's cursor to a
> specific formfield in the main document?

ActiveDocument.Bookmarks("Text1").Range.Fields(1).Result.Select

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Karen Clark - 01 Dec 2004 15:44 GMT
ActiveDocument.Bookmarks("Text1").Range.Fields
(1).Result.Select

If I am understanding correctly, that procedure would move
my cursor to a specific field in the SAME document.

I need to move my cursor to a specific field in the MAIN
document after saving and closing the EMBEDDED document.
Jean-Guy Marcil - 01 Dec 2004 18:21 GMT
Karen Clark was telling us:
Karen Clark nous racontait que :

> ActiveDocument.Bookmarks("Text1").Range.Fields
> (1).Result.Select
[quoted text clipped - 4 lines]
> I need to move my cursor to a specific field in the MAIN
> document after saving and closing the EMBEDDED document.

Exactly, I understood from you post that you needed to get to a specific
field after closing the embedded document. So, how can any code take you to
a field in an embedded document after it is closed? Once the embedded
document is closed ActiveDocument refers to the MAIN document, unless you
have a bunch of opened documents.

To have more control, do this:

At the top of the code:

Dim CurrentDoc As Document
Set CurrentDoc = ActiveDocument

Since the code hasn't had time to mess around with anything yet, it is 100%
certain that CurrentDoc will point to the doc where the call was initiated
(the MAIN document).

Then, mess around all you want with the embedded document or documents.

Then:

CurrentDoc.Bookmarks("Text1").Range.Fields(1).Result.Select

Will point to a bookmark in the MAIN document.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.