vbaprogammer
Programmer
I have written the following code in a form and in a class module (actually I got help from the internet). It works fine in VBA 6.0 (Word 2000), but will not work in VBA 5.0 (Word 97) -- it actually was written for VB.
I am writing an automation document with Word and need my new programming in Word 2000 to work in Word 97.
Here's the code. All I need is a translation from VBA 6.0 "event" to something that will work in VBA 5.0.
==========
This is the 6.0 code -- In Class Module (CWizard):
--------------
Option Explicit
Public Event Validate(ByRef CancelMove As Boolean)
Public Event DisplayStep()
Public Event Finish()
Private m_Step As Integer
Private m_StepCount As Integer
Public Property Get Step() As Integer
Step = m_Step
End Property
Public Property Let Step(nStep As Integer)
If nStep < 0 Or nStep >= m_StepCount Then
Exit Property
Else
m_Step = nStep
RaiseEvent DisplayStep
End If
End Property
[More code]
=========
6.0 In Form (frmMain):
-----------
Private WithEvents m_Wizard As CWizard
Dim SectionStart As Integer
Dim SectionEnd As Integer
\\\\\\\\\\\\\\\\\\\
VBA 5.0 (W97) doesn't like "Event" nor "RaiseEvent".
It will accept "WithEvents" in the Class Module, but I can't get the syntax correct and other things break.
I'd be happy to provide more info, if necessary.
Appreciate the help.
Thanks,
Dan
I am writing an automation document with Word and need my new programming in Word 2000 to work in Word 97.
Here's the code. All I need is a translation from VBA 6.0 "event" to something that will work in VBA 5.0.
==========
This is the 6.0 code -- In Class Module (CWizard):
--------------
Option Explicit
Public Event Validate(ByRef CancelMove As Boolean)
Public Event DisplayStep()
Public Event Finish()
Private m_Step As Integer
Private m_StepCount As Integer
Public Property Get Step() As Integer
Step = m_Step
End Property
Public Property Let Step(nStep As Integer)
If nStep < 0 Or nStep >= m_StepCount Then
Exit Property
Else
m_Step = nStep
RaiseEvent DisplayStep
End If
End Property
[More code]
=========
6.0 In Form (frmMain):
-----------
Private WithEvents m_Wizard As CWizard
Dim SectionStart As Integer
Dim SectionEnd As Integer
\\\\\\\\\\\\\\\\\\\
VBA 5.0 (W97) doesn't like "Event" nor "RaiseEvent".
It will accept "WithEvents" in the Class Module, but I can't get the syntax correct and other things break.
I'd be happy to provide more info, if necessary.
Appreciate the help.
Thanks,
Dan