PDA

View Full Version : Screen refresh



OTWarrior
10-11-2007, 07:41 AM
Is there a way of stopping the word docuemtn from doing a screen refresh AND having only one form field updating?

I have a problem with some of my code making the screen flicker (as I have alot of formfields on that page), and when I turn screenrefresh (or similar command) the proceedure doesn't work as I wished.

so something along the lines of (peusdo code):
activedocument.screenrefresh = false
activedocument.formfields("FFdropdown1").update = true

is there a command for this?

TonyJollans
10-11-2007, 07:46 AM
If you mean can you be selective in which update show on screen, then no. When you suppress screen updating, nothing shows; when you allow updating, everything shows.

icthus123
10-11-2007, 07:52 AM
Is there a way of stopping the word docuemtn from doing a screen refresh AND having only one form field updating?

I have a problem with some of my code making the screen flicker (as I have alot of formfields on that page), and when I turn screenrefresh (or similar command) the proceedure doesn't work as I wished.

so something along the lines of (peusdo code):
activedocument.screenrefresh = false
activedocument.formfields("FFdropdown1").update = true

is there a command for this?

Can't you just requery the control you want to update? Or am I completely missing what you want to do?

OTWarrior
10-11-2007, 07:53 AM
Can't you just requery the control you want to update? Or am I completely missing what you want to do?


do you mean disable screen refresh, but make the formfield requery itself?

icthus123
10-11-2007, 08:07 AM
do you mean disable screen refresh, but make the formfield requery itself?

Yes, basically! At least I don't see any reason why you couldn't do that?

fumei
10-11-2007, 09:20 AM
Tony is right. You may be able to update the formfield...but how could it be updated on the screen without a screen refresh? The screen contents come from the video buffer as a chunk. You can not (in Windows) localize a refresh by screen coordinates. Even if you could, you would have to HAVE the screen coordinates of the formfield.

In any case, a screen refresh gives the whole thing, as indicated by the word "screen". So yes, technically, you could make a formfield Result change, but it will not show on the screen until the screen is refreshed.

BTW: can you actually really use?

activedocument.screenrefresh = False

ScreenRefresh is an Application Method, and not associated with ActiveDocument, and it is not a Boolean property, but an actual Sub. See the Object Browser.

Further, AFAIK, there is no Update method for formfields. Fields, yes. Formfields, no. So:

activedocument.formfields("FFdropdown1").update = True

is not a valid instruction. (I know it was psuedo code)

Formfields ARE Fields. If you have only one thing in a document - a dropdown formfield - you do get a Field.Count. 1

And you CAN use something like:

ActiveDocument.Fields(1).Update

with no error, it will not DO anything. Further, you can not use Update on a Field by name.

ActiveDocument.Fields("Dropdown1") returns an error.

icthus123
10-12-2007, 12:29 AM
can't you just use:


Application.ScreenUpdating = False


While you're actually running the code, and then turn it on again and update the fields you want to update? I think that would get rid of the flickering.

OTWarrior
10-12-2007, 05:55 AM
I am currently using the application.screenupdating method during the proceedure to minimse the ammount of flicker, but the problem is I need the formfield to update everytime is changes, so the screenupdating is constantly being turned off and on again (whihc causes a flicker when it is turned back on).

The problem is I have to use alot of form fields in this document (519 including textboxes, dropdown form fields, and checkboxes) over 3 pages, which is most probably what causes the flicker.

if I can't figure out how to work around this, then I guess the users may just have to put up with it.....I'll tell them its the disco function ;)

Thanks for the help, I am finding out quite alot about words limitations with all of my threads :)

icthus123
10-12-2007, 06:00 AM
I am currently using the application.screenupdating method during the proceedure to minimse the ammount of flicker, but the problem is I need the formfield to update everytime is changes, so the screenupdating is constantly being turned off and on again (whihc causes a flicker when it is turned back on).

The problem is I have to use alot of form fields in this document (519 including textboxes, dropdown form fields, and checkboxes) over 3 pages, which is most probably what causes the flicker.

if I can't figure out how to work around this, then I guess the users may just have to put up with it.....I'll tell them its the disco function ;)

Thanks for the help, I am finding out quite alot about words limitations with all of my threads :)

Can you upload your document?

fumei
10-12-2007, 07:43 AM
519 formfields????? Yikes!!!! I would not mind seeing that myself.

OTWarrior
10-15-2007, 04:38 AM
unfortunately i cant upload it as it is an official document, and they are heavy on data protection here (when one colleague found out i was posting sample code on here, he got worried until i told him i changed the names of everything).

I will try to come up with a blanked out version, so you guys can see how it is displayed.