Sign in to follow this  
Followers 0
autosc

My script is freesing !

13 posts in this topic

The script freezes when i attempt to load a document from the tab "Load document ".

It loads document then , no way to close the script !

CODE
#include <GUIConstants.au3>

#include <IE.au3>

$oIE = _IECreateEmbedded()

$Form1_1 = GUICreate("Tabbed EXPERIMENT", 743, 489, 217, 134)

GUISetIcon("D:05.ico")

$PageControl1 = GUICtrlCreateTab(8, 8, 732, 440)

$TabSheet1 = GUICtrlCreateTabItem("")

$TabSheet2 = GUICtrlCreateTabItem("MYTAB1")

$TabSheet3 = GUICtrlCreateTabItem("MYTAB2")

$TabSheet4 = GUICtrlCreateTabItem("MYTAB3")

$TabSheet5 = GUICtrlCreateTabItem("MYTAB4")

$Edit1 = GUICtrlCreateEdit("", 40, 80, 673, 169)

GUICtrlSetData(-1, "AEdit1")

$TabSheet6 = GUICtrlCreateTabItem("MYTAB5")

$TabSheet7 = GUICtrlCreateTabItem("Load Document")

$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)

$GUI_Button_Open = GUICtrlCreateButton("load word", 660, 180, 53, 57, 0)

;GUICtrlSetState(-1,$GUI_SHOW)

;$Button1 = GUICtrlCreateButton("load word", 568, 128, 153, 57, 0)

$TabSheet8 = GUICtrlCreateTabItem("MYTAB7")

$TabSheet9 = GUICtrlCreateTabItem("MYTAB8")

$TabSheet10 = GUICtrlCreateTabItem("MYTAB9")

GUICtrlCreateTabItem("")

$Button1 = GUICtrlCreateButton("&Message1", 654, 456, 75, 25, 0)

$Button2 = GUICtrlCreateButton("&Message2", 142, 456, 75, 25, 0)

$Button3 = GUICtrlCreateButton("&EXIT", 16, 456, 75, 25, 0)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Button1

MsgBox(0, "Print", "Thbutton2.")

Case $msg = $Button2

MsgBox(0, "Print", "The file was printed.")

Case $msg = $GUI_Button_Open

$sFile = FileOpenDialog("Open Word File", @MyDocumentsDir, "Word Doc (*.Doc)")

If $sFile <> "" Then

_IENavigate ($oIE, $sFile, 0)

While $oIE.ReadyState <> 4

Sleep(50)

WEnd

$oDoc = $oIE.Document

$oWord = $oDoc.Application

; Put document into 'Web View' mode

$oWord.Activewindow.View = 6

; Manage display of toolbars

$oDoc.CommandBars ("Reviewing").visible = False

$oDoc.CommandBars ("Standard").Visible = True

EndIf

Case $msg = $Button3

ExitLoop

EndSelect

WEnd

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

add a Opt("TrayIconDebug", 1) at the top of your script to have an easy check where your script hangs..

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

add a Opt("TrayIconDebug", 1) at the top of your script to have an easy check where your script hangs..

Thanks Jdeb

I did that ..and the script hangs at

$msg = GUIGetMsg()

and i couldnt find the problem ....??

Share this post


Link to post
Share on other sites

Thanks Jdeb

I did that ..and the script hangs at

$msg = GUIGetMsg()

and i couldnt find the problem ....??

sounds to me you are in the main loop at that time ..

So what do you do exacty so we understand what you want to accomplish ...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

sounds to me you are in the main loop at that time ..

So what do you do exacty so we understand what you want to accomplish ...

I posted the script to show the problem . just run it and you may understand what ia want to accomplish.

I want to know if i have scripting errors or something ....

I am a learner and you are Experienced in autoit !

Share this post


Link to post
Share on other sites

I posted the script to show the problem . just run it and you may understand what ia want to accomplish.

I want to know if i have scripting errors or something ....

I am a learner and you are Experienced in autoit !

I have and still don't understand what you want ... so you will have to explain what you want to do to me before I can help you.

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Besides no COM error checking, have you tried to put Sleep() between some of the commands? This worked for me (Had to disable the icon thing):

If Not @error And $sFile <> "" Then
                _IENavigate($oIE, $sFile, 0)
                While $oIE.ReadyState <> 4
                    Sleep(50)
                WEnd
                $oDoc = $oIE.Document
                Sleep(50)
                $oWord = $oDoc.Application
                Sleep(50)
                ; Put document into 'Web View' mode
                $oWord.Activewindow.View = 6
                Sleep(50)
                ; Manage display of toolbars
                $oDoc.CommandBars ("Reviewing").visible = False
                Sleep(50)
                $oDoc.CommandBars ("Standard").Visible = True
                Sleep(50)
            EndIf


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I have and still don't understand what you want ... so you will have to explain what you want to do to me before I can help you.

:)

Run the script ! and you will grasp the problem ....

I guess , you dont want to understand !

any way , i dont want any more help from you ! Thanks !

Share this post


Link to post
Share on other sites

Run the script ! and you will grasp the problem ....

I guess , you dont want to understand !

any way , i dont want any more help from you ! Thanks !

This implies you do not believe me when I say I have run it ..

This is also rude to state I don;t want to understand when trying to help you ...

So yes ... I am done with you ....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Run the script ! and you will grasp the problem ....

I guess , you dont want to understand !

any way , i dont want any more help from you ! Thanks !

I think you miss the point here.

1. You don't explain yourself very well.

2. Why should we "have" to do anything... This is your problem, not ours. If you want help, then explain yourself clearly...

I for one, will never attempt to help you again, especially talking to someone so proficient as Jdeb like that, when all the while, it was your fault this thread had gone as long as it did.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

So yes ... I am done with you ....

I was wrong... couldn't resist and have checked you out and you better start to watch out from now on...

For one thing you can stop creating these extra accounts on this forum because they might get sudenly blocked ....

Service with a smile :)

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Damn, autosc....

This is a forum and you should be glad for any interest people have in helping you, and to serve comments

such as those in your last post isn't just very rude but also very stupid ! I mentioned the lack of respect in

my last post and it sure fits here as well...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0