G
Greg Mc
I have a developed a form that is downloaded each time a
customer (many and varied) needs to use it from the
Internet.
The AutoOpen sub (code below)is located in the
ThisDocument module and does various things when the form
is first opened.
Public Sub AutoOpen()
On Error Resume Next
ActiveWindow.View.ShowHiddenText = True ' shows the
hidden text to the user. This text will not print
'Application.EnableCancelKey =
wdCancelDisabled 'disables the ability for a user to break
the macro
Application.CommandBars("Update Details").Visible =
True 'displays the update details toolbar. This calls the
updetails procedure afeter user has filled in all details
Application.CommandBars("Update Details").Position =
msoBarFloating 'Positions toolbar as floating
Set BMRange = ActiveDocument.Bookmarks
("bkRentorFin").Range 'sets a range for the bookmark
If BMRange.Text = "" Then 'if there is no data in the
above bookmark it means this is a new document and need to
open user form
Set BMRange = Nothing 'makes sure the range is set
back to nothing
frmSelOpt.Show 'shows form
End If
ActiveDocument.FormFields
("bkFullName").Select 'selects first field on form
ActiveWindow.View = wdPageView 'ensures page layout
view
End Sub
My dilemma is this, if a user selects the "open" option
when downloading off the Internet the frmselopt.show does
not load. Also if the form is saved as a template and a
user selects it via File New, again frmselopt.show does
not load. It is almost as if someone is pressing the
Shift key when opening the form. Eveything else in the
procedure works fine. Another oddity when opening from the
Internet is that if the "Browse in Same Window" option is
checked within file types under Explorer the
frmselopt.show works fine. It also works without a
problem when opening from a normal doc.
Curiously as well the line Application.CommandBars("Update
Details").Position = msoBarFloating seems to be ignored
when opening from a template. It places the tool bar in
the last opened position (docked or undocked).
The form was written in word 97 but works well in other
versions.
Your help will be most appreciated
Greg Mc
customer (many and varied) needs to use it from the
Internet.
The AutoOpen sub (code below)is located in the
ThisDocument module and does various things when the form
is first opened.
Public Sub AutoOpen()
On Error Resume Next
ActiveWindow.View.ShowHiddenText = True ' shows the
hidden text to the user. This text will not print
'Application.EnableCancelKey =
wdCancelDisabled 'disables the ability for a user to break
the macro
Application.CommandBars("Update Details").Visible =
True 'displays the update details toolbar. This calls the
updetails procedure afeter user has filled in all details
Application.CommandBars("Update Details").Position =
msoBarFloating 'Positions toolbar as floating
Set BMRange = ActiveDocument.Bookmarks
("bkRentorFin").Range 'sets a range for the bookmark
If BMRange.Text = "" Then 'if there is no data in the
above bookmark it means this is a new document and need to
open user form
Set BMRange = Nothing 'makes sure the range is set
back to nothing
frmSelOpt.Show 'shows form
End If
ActiveDocument.FormFields
("bkFullName").Select 'selects first field on form
ActiveWindow.View = wdPageView 'ensures page layout
view
End Sub
My dilemma is this, if a user selects the "open" option
when downloading off the Internet the frmselopt.show does
not load. Also if the form is saved as a template and a
user selects it via File New, again frmselopt.show does
not load. It is almost as if someone is pressing the
Shift key when opening the form. Eveything else in the
procedure works fine. Another oddity when opening from the
Internet is that if the "Browse in Same Window" option is
checked within file types under Explorer the
frmselopt.show works fine. It also works without a
problem when opening from a normal doc.
Curiously as well the line Application.CommandBars("Update
Details").Position = msoBarFloating seems to be ignored
when opening from a template. It places the tool bar in
the last opened position (docked or undocked).
The form was written in word 97 but works well in other
versions.
Your help will be most appreciated
Greg Mc