Search found 69 matches

by Stavencross
27 Mar 2019, 10:18
Forum: Ask For Help
Topic: Accessing Word COM events from within a function Topic is solved
Replies: 3
Views: 106

Re: Accessing Word COM events from within a function Topic is solved

In your function, the variable '"wdApp" is cleared as soon as the function returns. You need to save that reference somewhere. You could return it from the function. Or if you are only going to have one instance of word open then you can just make wdApp static so that it will keep its contents afte...
by Stavencross
27 Mar 2019, 08:46
Forum: Ask For Help
Topic: Navigating drop down menus
Replies: 1
Views: 60

Re: Navigating drop down menus

I am attempting to create a simple script for work that fills out SalesForce cases. As seen in the attachment, I'm able to get the text boxes filled out, but cannot seem to work a command that completes the "category" and "status" drop down menus. I've tried {Down} arrow and {Enter} commands, but w...
by Stavencross
27 Mar 2019, 08:27
Forum: Ask For Help
Topic: Accessing Word COM events from within a function Topic is solved
Replies: 3
Views: 106

Re: Accessing Word COM events from within a function Topic is solved

Thank you, in advance, for any assistance that can be offered!
by Stavencross
27 Mar 2019, 08:27
Forum: Ask For Help
Topic: Accessing Word COM events from within a function Topic is solved
Replies: 3
Views: 106

Accessing Word COM events from within a function Topic is solved

Good morning. Yesterday I was finally able to figure out how to access COM events connected to a word document. However, when I wrap the code into a function, the events don't seem to trigger any more. I'd like to be able to make the first codeblock work correctly and create an event listener from w...
by Stavencross
27 Mar 2019, 08:18
Forum: Ask For Help
Topic: Word COM on Close event capture Topic is solved
Replies: 6
Views: 239

Re: Word COM on Close event capture Topic is solved

1. beg a question 2. get an answer code from someone else 3. check its own comment as an answer 4. conveniently not using the basic word ' thanks ' Brilliant !!! Apologies, I had written a response with a thank you in it and forgot to click submit on my way to a meeting. Thank you very much for you...
by Stavencross
26 Mar 2019, 11:27
Forum: Ask For Help
Topic: Word COM on Close event capture Topic is solved
Replies: 6
Views: 239

Re: Word COM on Close event capture Topic is solved

I was able to take part of the replies to make the following: #Persistent wdApp := ComObjCreate("Word.Application") ;create a word app wdApp.Visible := true oConnect := ComObjConnect(wdApp,"wd_") ;connect to events wdApp.Documents.Add() ;add a new document wd_NewDocument(Doc,App) { ;when creating a ...
by Stavencross
26 Mar 2019, 07:09
Forum: Ask For Help
Topic: Word COM on Close event capture Topic is solved
Replies: 6
Views: 239

Word COM on Close event capture Topic is solved

I'm trying to pop up a message box when the word app is closed, but I can't seem to figure out what the event is named. If possible, I'd also like to figure out how to pop up a message box when the doc has been saved. wdApp := ComObjCreate("Word.Application") ;create a word app wdApp.Visible := true...
by Stavencross
22 Jan 2019, 10:47
Forum: Ask For Help
Topic: [SOLVED] WebApp.Ahk crash on key spam
Replies: 3
Views: 286

Re: [SOLVED] WebApp.Ahk crash on key spam

I finally solved this issue (2 yrs later) There is a function SetWBClientSite() at the end, I had to comment the if() block out. It looks like it was maybe sending out to many DLL calls due to the spam? I modified the func to this: SetWBClientSite() { interfaces := { (Join, IOleClientSite: [0,3,1,0,...
by Stavencross
20 Jan 2019, 09:45
Forum: Scripts and Functions
Topic: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Replies: 132
Views: 33619

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

Thanks for the library GeekDude! My question: Can I run multiple instances of this class? I would like to have many controllable windows open at the same time. I tried this, but failed. #include <External\Chrome> ; Create an instance of the Chrome class using ; the folder ChromeProfile to store the...
by Stavencross
25 Sep 2018, 13:31
Forum: Tips and Tricks
Topic: COM Object method .Quit() not killing process
Replies: 1
Views: 814

COM Object method .Quit() not killing process

I spent about 6 hours this week struggling with powerpoint not quitting when I was calling the .Quit() method. I stumbled across : https://stackoverflow.com/questions/3197263/application-quit-method-failing-to-clear-process which lead me to https://support.microsoft.com/en-us/help/317109/office-appl...
by Stavencross
21 Sep 2018, 09:04
Forum: Tips and Tricks
Topic: [GUI] Use HTML and CSS for your GUIs!
Replies: 118
Views: 59638

Re: [GUI] Use HTML and CSS for your GUIs!

Yes Kczx3 was correct. Yesterday I redesigned the whole 1000 line function to utilize a GUI instead for control instead of messagebox. that fixed everything
by Stavencross
21 Sep 2018, 09:00
Forum: Scripts and Functions
Topic: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Replies: 132
Views: 33619

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

And as I wear out my welcome here, I think I've found a bug of some type. After I make a dozen or so DOM JS calls, AHK locks up and this is what I'm seeing for output: 037: if i := InStr("{[", ch) 047: if InStr("}]", ch) 049: ObjRemoveAt(stack, 1) 050: next := stack[1]==tree ? "" : is_arr[stack[1]]...
by Stavencross
19 Sep 2018, 14:13
Forum: Ask For Help
Topic: PowerPoint COM Add/Remove Slide event
Replies: 3
Views: 260

PowerPoint COM Add/Remove Slide event

Good afternoon! I'm trying to connect my script to the Powerpoint New Slide event. I tried applying my post:https://autohotkey.com/boards/viewtopic.php?p=238437#p238437, but I couldn't figure it out. When a user adds a new slide to the presentation, I'd like to have a class that loops through the en...
by Stavencross
13 Sep 2018, 16:15
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

Your example works perfectly. However, when I drop the mail creation into a function, the class is no longer called? #Persistent makeanemail() makeanemail() { static olMailItem := 0 ol := ComObjCreate("Outlook.Application") newMail := ol.CreateItem(olMailItem) newMail.Subject := "Hello World!" newM...
by Stavencross
13 Sep 2018, 16:10
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

Before I did not see much point in wrapping it in a class but this is pretty slick for limiting the scope of variables to the method/function. In the past, I have taken the lazy approach and just used a global variable to get info into the event function but this is cooler. I will remember this for...
by Stavencross
13 Sep 2018, 15:48
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

#Persistent olMailItem := 0 ol := ComObjCreate("Outlook.Application") newMail := ol.CreateItem(olMailItem) newMail.Subject := "Hello World!" newMail.Display ; you can pass params when creating the object MailEventsObj := new MailItemEvents("samesfordfd") ; you can also add to the object after it is...
by Stavencross
13 Sep 2018, 15:04
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

#Persistent olMailItem := 0 ol := ComObjCreate("Outlook.Application") newMail := ol.CreateItem(olMailItem) newMail.Subject := "Hello World!" newMail.Display ; you can pass params when creating the object MailEventsObj := new MailItemEvents("samesfordfd") ; you can also add to the object after it is...
by Stavencross
13 Sep 2018, 14:31
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

#Persistent olMailItem := 0 ol := ComObjCreate("Outlook.Application") newMail := ol.CreateItem(olMailItem) newMail.Subject := "Hello World!" newMail.Display ; Connect to newMail events ComObjConnect(newMail, new MailItemEvents) return class MailItemEvents { ; MailItem.Send Event (Outlook) ; https:/...
by Stavencross
13 Sep 2018, 13:37
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Re: Capture SendMail event in Outlook COM

#Persistent olMailItem := 0 ol := ComObjCreate("Outlook.Application") newMail := ol.CreateItem(olMailItem) newMail.Subject := "Hello World!" newMail.Display ; Connect to newMail events ComObjConnect(newMail, new MailItemEvents) return class MailItemEvents { ; MailItem.Send Event (Outlook) ; https:/...
by Stavencross
13 Sep 2018, 10:51
Forum: Ask For Help
Topic: Capture SendMail event in Outlook COM
Replies: 11
Views: 463

Capture SendMail event in Outlook COM

I'm trying to figure out how to popup a messagebox when a user clicks Send in an email that was created via outlook COM MessageSubject := "Hello World!" CCAddress := "noreply@noreply.com" ol := ComObjCreate("Outlook.Application") ns := ol.getNamespace("MAPI") ns.logon("","",true,false) newMail := ol...

Go to advanced search