VBA - formfield, minimize, maximize problem

T

Theo Hayes

We are using a system to feed data into Word form fields.
Word is opened and an AutoOpen macro of
Application.WindowState = wdWindowStateMinimize is
triggered. However the window maximizes each time data is
fed into a form field. This didn't occur when using Word
2000 but has been a problem after upgrading to XP. Here is
a sample of the code we are using

'* working area defined below
Dim Q as String
Global Err as Integer
Global Pg as String
Dim Xspace as string

'**********************************************************
*********************************
'* * Initialize Variables
* *
'**********************************************************
*********************************
Q=Chr(34) '* Chr(34) ="


'* below opens the document. At this point windows is
minimized

DDEExecute
(DDEHandle,"[FileOpen.Name="+Q+@"@&Path@"+@"@&&Doc@"+Q+",.R
eadOnly=1]")

'* Exchange data - Pass Variables Here!
'* after below statement the document comes out of
minimize. Sending a global variable to the bookmark
called POLICY.

DDEExecute
(DDEHandle,"[SetFormResult "+Q+"POLICY"+Q+","+Q+@"@&&Policy
@"+Q+", 1"+"]")


Any ideas?
 
W

Word Heretic

G'day "Theo Hayes" <[email protected]>,

I see several problems. #1: Err is a reserved word, so don't use it as
a var.

#2: I am not too surprised at this - I think its their hack to get
around some focus problems. Just minimize the app again after that
line.

You could try - but I hate it - making the document invisible too.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Theo Hayes reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top