Hi,
It seems the crashing issue turns out be complex, if you would, I suggest
you to contact Microsoft Product Support Services at:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
A dedicated Support Professional will assistant you to resolve the issue.
Sincerely,
Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <
www.microsoft.com/security>
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: <
[email protected]>
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| Well, in the end it doesn't matter. This code:
|
| Set ctrl = wordApp.CommandBars("Menu Bar").Controls("Save
| as...")
|
| ctrl.Enabled = False
|
| works a little too well in that it disables Save as in all
| instances of word until I run code to enable it. Since
| Access is a little flaky about catching when an OLE object
| is closed I'm afraid to implement this. I think I'll just
| give them the old 'you were bad and now you must pay'
| message box and let it crash.
|
| Today I had a chance to run my code on an XP box w/ Office
| 2002. Access still crashes. In addition, in this scenario
| I tried a 'Save As Web Page' and cause an equally
| interesting problem. Since Internet Explorer is not
| enabled as an OLE Server the file, which is happily
| converted to a .htm file, is no longer accessible from the
| OLE container control. It's always something...
|
|
| >-----Original Message-----
| >Hi,
| >
| >Thanks for your feedback.
| >
| >I am not sure why the code doesn't work on your side.
| >
| >Set ctrl = wordApp.CommandBars("Menu Bar").Controls
| ("File").Controls("Save
| >as...")
| >
| >However, the following code can be clearer about the
| object
| >module/hiberarchy.
| >
| > Dim wordApp As Word.Application
| > Dim CBarMenu As CommandBar
| > Dim CBarCtl As CommandBarPopup
| > Dim ctl As CommandBarControl
| >
| > Set wordApp = CreateObject("Word.Application")
| >
| > With wordApp
| >
| > .WindowState = wdWindowStateMaximize
| > .Documents.Add
| >
| > End With
| >
| > wordApp.Visible = True
| >
| > Set CBarMenu = wordApp.CommandBars("Menu Bar")
| > Set CBarCtl = CBarMenu.Controls("File")
| > Set ctl = CBarCtl.Controls("Save as...")
| > ctl.Enabled = False
| >
| >
| >Please feel free to reply to the threads if you have any
| concerns or
| >questions.
| >
| >
| >
| >Sincerely,
| >
| >Alick Ye, MCSD
| >Product Support Services
| >Microsoft Corporation
| >Get Secure! - <
www.microsoft.com/security>
| >
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
| >
| >
| >
| >
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Fly Girl" <
[email protected]>
| >| Sender: "Fly Girl" <
[email protected]>
| >| X-Tomcat-NG: microsoft.public.access.formscoding
| >|
| >| Hi Alick,
| >|
| >| Thanks for hanging in there with me on this one.
| Yesterday
| >| I spent pretty much the entire morning just happily
| >| crashing Access and came to the conclusion that it
| always
| >| runs all the code first so, in the end, it is only an
| >| inconvenience for the user.
| >|
| >| Whatever it is, it's very consistent on my machine!
| Today
| >| I have an opportunity to see what happens on XP.
| >|
| >| I will consider manually creating the instance of Word
| and
| >| disabling Save As. Right now I'm feeling a bit evil and
| >| thinking of just sending a message to the user
| explaining
| >| that they have been VERY bad and will now have to re-
| start
| >| the application... heh, heh...
| >|
| >| What can I say, it's Tuesday and there are still 4 more
| >| days of slogging through this ahead of me.
| >|
| >| Thanks again!
| >| Gail
| >|
| >| >-----Original Message-----
| >| >Hi,
| >| >
| >| >The crashing issue is usually hard to troubleshooting,
| if
| >| disabling the
| >| >Save As menu can resolve your issue, we can try
| >| CommandBarControl object to
| >| >access the Save as menu and disable it. Below is s
| ample
| >| for your reference;
| >| >
| >| >
| >| > Dim wordApp As Word.Application
| >| >
| >| > Dim ctrl As CommandBarControl
| >| >
| >| > Set wordApp = CreateObject("Word.Application")
| >| >
| >| > With wordApp
| >| >
| >| > .WindowState = wdWindowStateMaximize
| >| > .Documents.Add
| >| >
| >| > End With
| >| >
| >| > wordApp.Visible = True
| >| >
| >| > Set ctrl = wordApp.CommandBars("Menu
| >| >Bar").Controls("File").Controls("Save as...")
| >| >
| >| > ctrl.Enabled = False
| >| >
| >| >Please feel free to reply to the threads if you have
| any
| >| concerns or
| >| >questions.
| >| >
| >| >
| >| >
| >| >Sincerely,
| >| >
| >| >Alick Ye, MCSD
| >| >Product Support Services
| >| >Microsoft Corporation
| >| >Get Secure! - <
www.microsoft.com/security>
| >| >
| >| >This posting is provided "AS IS" with no warranties,
| and
| >| confers no rights.
| >| >
| >| >
| >| >--------------------
| >| >| Content-Class: urn:content-classes:message
| >| >| From: "Fly Girl" <
[email protected]>
| >| >| X-Tomcat-NG: microsoft.public.access.formscoding
| >| >|
| >| >| Thanks Alick,
| >| >|
| >| >| I tried running the code in Safe Mode on Win2K and
| it
| >| >| still crashed the application.
| >| >|
| >| >| Currently this failure leaves a small hole in my
| >| document
| >| >| control process in that there is one instance of
| user
| >| >| actions that I cannot control. The only way that I
| >| would
| >| >| end up running the code that causes this crash is if
| >| the
| >| >| user does a 'Save As' in Word and saves the document
| to
| >| a
| >| >| different name.
| >| >|
| >| >| Is there any way of disabling the 'Save As' feature
| of
| >| >| Word when opened via Access as an OLE Server? Or is
| >| there
| >| >| any setting I can make so that when the user does
| >| a 'Save
| >| >| As' on Win2K that the link in the OLE field in the
| >| >| database will continue to point to the original file
| >| >| instead of being replaced with a link to the new
| file?
| >| >|
| >| >| Note: this is not an issue in XP as in XP the link
| will
| >| >| remain with the original file and not with file
| created
| >| by
| >| >| the 'Save As'.
| >| >|
| >| >| Also, please note that there is no report involved
| in
| >| this
| >| >| process. Forms only at this point.
| >| >|
| >| >| Thanks for your help!
| >| >|
| >| >
| >| >.
| >| >
| >|
| >
| >.
| >
|