Advertisement

04.29.2008 at 06:06PM PDT, ID: 23364138
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Find maximum timeout period for Word SpellChecker dialogbox

Tags: VBA (Macro), Powerbuilder 9.0, Internet Explorer 6
I am trying to use the MS Word spell checker function through Powerbuilder 9.0.1 and so far the code seems to function correct. However, I would like to use a timeout period for the Spell Checker window as the OLE object in Powerbuilder is set to expire in 2 hours. The following line of code is used in PB:
lole_Spell.Application.Dialogs.Item(828).Display (7200000)  this is similar to using Dialogs.Item(828).Display (7200000) in Macro too.

Even though the timeout period is set to appx 2 hours the spell checker seems to expire in appx 1 min. When Display method is used on its own with out a timeout period (Dialogs.Item(828).Display()) the Spell Checker never expires and the system crashes in 2 hours once the OLE object expires through power builder.
I would appreciate if anyone can help me in finding the maximum timeout period for a dialog box in VBA and if its 1 min how can I make the dialog box to expire after 2 hours.
Any help would be appreciated..

Ash
p:s I've attached a simple VBA code similar to what I am trying to do above if my explanation didnt help you understand much.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
Private Sub CommandButton1_Click()
 
    Dim lstart  As Date
    Dim lend As Date
    Dim result As Integer
    
    Dim ltimeout As Long
    
    ltimeout = 300000000
    
 
    lstart = Now()
    
    result = Dialogs.Item(828).Display(ltimeout)
    
     
    
    lend = Now()
    
    MsgBox ("Start Time: " & lstart & Chr(13) & "End Time: " & lend _
            & Chr(13) & "Result: " & result)
 
End Sub
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: gamblor
Solution Provided By: gamblor
Participating Experts: 3
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
04.30.2008 at 02:08AM PDT, ID: 21469069

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.30.2008 at 10:58PM PDT, ID: 21476749

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.01.2008 at 11:38AM PDT, ID: 21481314

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.01.2008 at 12:00PM PDT, ID: 21481527

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.01.2008 at 06:04PM PDT, ID: 21483907

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.02.2008 at 09:36AM PDT, ID: 21488055

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.04.2008 at 05:41PM PDT, ID: 21497544

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 07:14PM PDT, ID: 21512706

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.20.2008 at 09:36PM PDT, ID: 21612157

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.30.2008 at 02:08AM PDT, ID: 21469069

Rank: Wizard

Hi,

can u post ur PB code here... wud help in trying alternatives...

Cheers,
Rosh
 
04.30.2008 at 10:58PM PDT, ID: 21476749
Hi there,
Following is my PB code.. this issue is more relating to VBA than PB but if you got any suggestions its much appreciated.

Cheers

// Connect to word and do spell check
lole_Spell = CREATE OleObject
ll_RC = lole_Spell.ConnectToNewObject( 'Word.Application' )
IF ll_RC <> 0 THEN
      DESTROY lole_Spell
      RETURN ll_RC
END IF

TRY
      ll_TimeOut = 7200500 // 2.00014 Hours
      lole_Spell.SetAutomationTimeout(ll_TimeOut)
      
      lole_Spell.Application.Visible = False
      lole_Spell.Application.WindowState = 2
      lole_Spell.Documents.Add()
      lole_Spell.Selection.TypeText( as_Text )
      lole_Spell.Selection.HomeKey()
      lole_Spell.Selection.MoveStart()
//      lole_Spell.ActiveDocument.CheckSpelling()
      lole_Spell.ActiveDocument.SpellingChecked = FALSE
      lole_Spell.ActiveDocument.GrammarChecked = TRUE
      lole_Spell.Application.Dialogs.Item(828).Display (7200000)
      //828 - wdDialogToolsSpellingAndGrammar
      //7200000 - 2 Hours timeout duration (Spell Check dialogbox should always time out before the OLE timeout duration)
      lole_Spell.ActiveDocument.Select()
      as_Text = lole_Spell.Selection.Text
      //last change
      IF RIGHT(as_Text,1)=CHAR(13) THEN
            as_Text = MID(as_Text,1,LEN(as_Text)-1)
      END IF
CATCH (OLERuntimeError le_OLERE)
      IF le_OleRe.number = 35 THEN //Time out error
            f_err(f_ErrStr(50552,"OLE Runtime Error: " + f_key2(le_OLERE.Text) + " The Spell Checker dialog box has timed out"), 'S', '')
      ELSE
            f_err(f_ErrStr(50552,"OLE Runtime Error: " + f_key2(le_OLERE.Text)), 'S', '')
      END IF
CATCH (NullObjectError le_NOE)
      f_err(f_ErrStr(50552," Null Object Error: " + f_key2(le_NOE.Text)), 'S', '')
CATCH (RuntimeError le_RE)
      f_err(f_ErrStr(50552," Runtime Error: " + f_key2(le_RE.Text)), 'S', '')
FINALLY
      lole_Spell.ActiveDocument.Close(FALSE)
      lole_Spell.Application.Quit
      lole_Spell.DisconnectObject()
      DESTROY lole_Spell
      RETURN 0
END TRY
 
05.01.2008 at 11:38AM PDT, ID: 21481314

Rank: Master

what version of ms word?
I know that some dialogs will ignore the timeout setting completely, eventually the spell checker does not take the value into account?
 
05.01.2008 at 12:00PM PDT, ID: 21481527

Rank: Guru

I think you can specify any valid value for TimeOut. Use function 'Show' instead of 'Display'. I tested it and works fine with any valid TimeOut value.

If you don't specify any value to Show function, means there is no timeout. And I believe that should be the same with Display function too for No TimeOut.
e.g
lole_Spell.Application.Dialogs.Item(828).Display()  // No TimeOut

I tried...
lole_Spell.Application.Dialogs.Item(828).Show()  // No TimeOut
lole_Spell.Application.Dialogs.Item(828).Show(720)
lole_Spell.Application.Dialogs.Item(828).Show(7200)
lole_Spell.Application.Dialogs.Item(828).Show(72000)

Regards,
Sandeep



 
05.01.2008 at 06:04PM PDT, ID: 21483907
angellll, i am using MS Word 2003 SP2.. i wouldn't say that the dialogbox seems to ignor whatever timeout value i specify but any larger value i've tried specifing expires in about a minute

Sandeep: ive already tried both display and show method which dont seem to stay over a minute.
72000 - shows up for 6 sec
720000 - shows up for 65 sec
7200000 - shows up for 57 sec
72000000 - shows up for 42 sec
Like i explained in my previous post, the longer i expect it to show up it shows up around the 1 min mark and timesout..
 
05.02.2008 at 09:36AM PDT, ID: 21488055

Rank: Guru

I tried this yesterday and was working fine with the exact time outs. And today it's not..means something is wrong with word + pb + os + any other application.

Meanwhile try below code, if it suits your requirement.

http://www.devx.com/tips/Tip/24943

Regards,
Sandeep
 
05.04.2008 at 05:41PM PDT, ID: 21497544
Woah! Sandeep it makes us two with the same problem. I tested my code few weeks back and i remember it worked for 20 mins but now it doesn't which is a big puzzle.

Thanks for the code you provided. It pretty exact to what ive done except I have included code to handle OLE errors with TRY and CATCH.

This is really annoying and fustrating not being able to get around this problem but hope you guys are digging in further for a solution as I am.

Cheers.
 
05.06.2008 at 07:14PM PDT, ID: 21512706
still no luck folks?
 
05.20.2008 at 09:36PM PDT, ID: 21612157
Since no one is able to provide me solution I have planned to develop my own custom made spell checker and decided to close this question.
Accepted Solution
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628