A
Anne P.
I have a userform in a Memo template with a Combo Box which lists Atty info
(this info is stored in a template named Personal.dot). There is also a
command button which when clicked opens a new userform where atty info
filled in and saved, edited or deleted. When the memo is first run, the
combo box contains all stored atty info. However, if the user clicks the
command button to add, edit or delete atty info, when they are returned to
the Memo template userform, the combo box with the user info is not updated
with the new information.
I have the following code placed in the userform_activate event. (All
variables are declared and Option Explicit is on). I initially had it in
the Initialize event of the userform but it did not work, so I moved it to
Activate, but it still does not work. I don't know if it is the code, or if
I am using the wrong event.
=========================================================
mstrGlobalPath = Options.DefaultFilePath(wdStartupPath) & "\SKGlobal.dot"
Set mObjGlobal = Templates(mstrGlobalPath)
mstrPersonalPath = Options.DefaultFilePath(wdStartupPath) &
"\Personal.dot"
Set mObjPersonal = Templates(mstrPersonalPath)
'Fill Offices combobox with letterhead choices from SKGlobal
For Each mObjAtE In mObjGlobal.AutoTextEntries
If mObjAtE.StyleName = "logoAddress" Then
If Left(mObjAtE.Name, 2) = "NY" Or Left(mObjAtE.Name, 2) = "DC" Then
cmbOffices.AddItem mObjAtE.Name
End If
End If
Next mObjAtE
'Fill Re Line combobox with relines
For Each mObjAtE In mObjPersonal.AutoTextEntries
If mObjAtE.StyleName = "ReLine" Then
cmbReLine.AddItem mObjAtE.Name
End If
Next mObjAtE
'Fill user combobox
For Each mObjAtE In mObjPersonal.AutoTextEntries
If mObjAtE.StyleName = "UserInfo" Then
cmbAtty.AddItem mObjAtE.Name
End If
Next mObjAtE
================================================
I would appreciate any insight to fixing this problem.
Thanks, Anne P.
(this info is stored in a template named Personal.dot). There is also a
command button which when clicked opens a new userform where atty info
filled in and saved, edited or deleted. When the memo is first run, the
combo box contains all stored atty info. However, if the user clicks the
command button to add, edit or delete atty info, when they are returned to
the Memo template userform, the combo box with the user info is not updated
with the new information.
I have the following code placed in the userform_activate event. (All
variables are declared and Option Explicit is on). I initially had it in
the Initialize event of the userform but it did not work, so I moved it to
Activate, but it still does not work. I don't know if it is the code, or if
I am using the wrong event.
=========================================================
mstrGlobalPath = Options.DefaultFilePath(wdStartupPath) & "\SKGlobal.dot"
Set mObjGlobal = Templates(mstrGlobalPath)
mstrPersonalPath = Options.DefaultFilePath(wdStartupPath) &
"\Personal.dot"
Set mObjPersonal = Templates(mstrPersonalPath)
'Fill Offices combobox with letterhead choices from SKGlobal
For Each mObjAtE In mObjGlobal.AutoTextEntries
If mObjAtE.StyleName = "logoAddress" Then
If Left(mObjAtE.Name, 2) = "NY" Or Left(mObjAtE.Name, 2) = "DC" Then
cmbOffices.AddItem mObjAtE.Name
End If
End If
Next mObjAtE
'Fill Re Line combobox with relines
For Each mObjAtE In mObjPersonal.AutoTextEntries
If mObjAtE.StyleName = "ReLine" Then
cmbReLine.AddItem mObjAtE.Name
End If
Next mObjAtE
'Fill user combobox
For Each mObjAtE In mObjPersonal.AutoTextEntries
If mObjAtE.StyleName = "UserInfo" Then
cmbAtty.AddItem mObjAtE.Name
End If
Next mObjAtE
================================================
I would appreciate any insight to fixing this problem.
Thanks, Anne P.