
Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thank you for your reply Graham,
I did what you suggested and now I get other error msg (Run-time error:
’438’ Object doesn’t support this property or method) while setting the
window state property.
I have modified the macro to fit your suggestion ‘cause I forgot to say that
the file opened manually in this sub (asterisk in the begin of line shows
what I changed):
First I got the error with “.WindowState = wdWindowStateNormal”, so I
decided to comment it and the error was the same with “.Top = 0”.
It seems that this way I can’t change the properties or do you think that I
made a mistake somewhere.
Thanks a lot for your help and patience.
Hans
The code:
Private Sub Openleft_Click()
LeftName = MyOpen
LeftName = ActiveDocument.FullName
LeftShortName = ActiveDocument.Name
LeftFilePath = ActiveDocument.Path
If Right$(LeftFilePath, 1) <> "\" Then LeftFilePath = LeftFilePath & "\" '
Add a Backslah to the end of the path if it does not exist
* Set Leftfile = ActiveDocument
End Su
---------------------------------------------------------------------------------
Function MyOpen() As String
Dim a As String
With Dialogs(wdDialogFileOpen)
.Show
a = .Name
End With
End Functio
---------------------------------------------------------------------------------
Private Sub startbutton_Click()
If (LeftName <> "") And (GloName <> "") Then
GloForm.Hide
If Not OneSideBox.Value Then
** With Glofile
.Activate
' .WindowState = wdWindowStateNormal
End With
With Leftfile
.Activate
' .WindowState = wdWindowStateNormal
End With
With Rightfile
.Activate
' .WindowState = wdWindowStateNormal
End With
** With Rightfile
.Activate
.Top = 0
.Left = Application.UsableWidth / 2
.Height = Application.UsableHeight
.Width = Application.UsableWidth / 2
End With
** With Leftfile
.Activate
.Top = 0
.Left = 0
.Height = Application.UsableHeight
.Width = Application.UsableWidth / 2
End With
Else
Leftfile.Activate
End If
LeftFlag = True
CustomizationContext = NormalTemplate
Set MyKeyESC = KeyBindings.Add(wdKeyCategoryMacro, "Left",
(BuildKeyCode(wdKeyEsc)))
Set MyKeyStop = KeyBindings.Add(wdKeyCategoryMacro,
"GLOSSARY.glomacros.StopRecordingGlossary", (BuildKeyCode(wdKeyControl,
wdKeyReturn)))
RecordFlag = True
** Leftfile.Activate
End If
End Sub
> Something like
>
[quoted text clipped - 7 lines]
>
> will work in either version.
Russ - 23 Jul 2007 18:56 GMT
Hans,
One quick thing I noticed is that a function returns its value by setting
the function name to the return value. For example:
Function MyOpen() As String
Dim a As String
With Dialogs(wdDialogFileOpen)
.Show
MyOpen = .Name ' not a = .Name
End With
End Function
> Thank you for your reply Graham,
> I did what you suggested and now I get other error msg (Run-time error:
[quoted text clipped - 105 lines]
>>
>> will work in either version.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Hans Ruopp - 24 Jul 2007 17:24 GMT
Hi Russ
Thanks for the tip I already corrected the macro but curiously this function
worked fine. But my main problem still being the change of window property as
I describe above.
Thanks again for you help
Hans
> Hans,
> One quick thing I noticed is that a function returns its value by setting
[quoted text clipped - 6 lines]
> End With
> End Function
Russ - 25 Jul 2007 07:25 GMT
Hans,
Look at Graham's example more closely.
It looks like you are leaving out the property:
.ActiveWindow
With Leftfile.ActiveWindow
...
> Thank you for your reply Graham,
> I did what you suggested and now I get other error msg (Run-time error:
[quoted text clipped - 105 lines]
>>
>> will work in either version.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Hans Ruopp - 25 Jul 2007 08:06 GMT
Russ,
You're absolutely right. now it works. Thanks a lot for your patience and
valuable help.
Regards
Hans
> Hans,
> Look at Graham's example more closely.
[quoted text clipped - 113 lines]
> >>
> >> will work in either version.