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 / February 2005

Tip: Looking for answers? Try searching our database.

Document_New() VS. Bookmarks...Sequence

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paulmac106@hotmail.com - 24 Feb 2005 17:51 GMT
A user opens a word template from an Access application, Bookmarks are
filled...then I have some code under Document_New.

I need to capture a string insterted by the bookmark, then run my code.

The problem is that Document_New seems to fire before the bookmarks are
filled...thus giving me an empty string.

Do you know of any workarounds?

thanks,
Paul

btw, the Access Application is store bought, so I can't program within
it.
Jezebel - 24 Feb 2005 22:01 GMT
Nothing 'seems to' about it. Document_New, by definition, is fired when the
document is created and before anything is done to it.

You could try monitoring the WindowsSelectionChange event -- depending on
how the Access app works, there may be some sequence of selections you can
recognize and act on.

Or you could start a timer in Document_New, wait 30 seconds (or however long
the access app takes), then run your code.

Or start a loop that idles a while then checks the value of your bookmark,
and loops until it changes.

Or monitor the task manager, watching until the access app has finished.

>A user opens a word template from an Access application, Bookmarks are
> filled...then I have some code under Document_New.
[quoted text clipped - 11 lines]
> btw, the Access Application is store bought, so I can't program within
> it.
paulmac106@hotmail.com - 28 Feb 2005 13:00 GMT
It looks like loops and timers happen before the bookmarks fill too.

could you tell me more about WindowsSelectionChange

thanks,
Paul

> Nothing 'seems to' about it. Document_New, by definition, is fired when the
> document is created and before anything is done to it.
[quoted text clipped - 26 lines]
> > btw, the Access Application is store bought, so I can't program within
> > it.
Jezebel - 28 Feb 2005 22:07 GMT
WindowsSelectionChange is one of the events fired by Word -- fired each time
the selection changes. It will help in your case only if the Access app uses
the selection to make its changes, as opposed to working with Range objects.

To trap it you need a class module with a WithEvents reference to the Word
application object. There's an example in Help under a topic called
something like "Working with Word events".

> It looks like loops and timers happen before the bookmarks fill too.
>
[quoted text clipped - 43 lines]
> within
>> > it.
 
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.