krystian
Active Members-
Posts
24 -
Joined
-
Last visited
krystian's Achievements
Seeker (1/7)
1
Reputation
-
Jonatas reacted to a post in a topic:
Send keys to minimized window
-
Actually, metadata lookup for the number of pages wasn't the best idea. Summary: The metadata value for the number of pages sometimes didn't update when I made word docs to test with. For instance, I made a word doc, scribbled some text and copied and pasted to make it fit 3 pages with some page breaks. Saved. The metadata showed only 1 page. I'm using Office XP, which might be why this is a problem (since it is older and perhaps stuff has updated in the newer versions making this an non-issue). Nevertheless, this might be a good example why not to use the dso dll to read metadata... sometimes it's downright inaccurate! (weird stuff might happen, like above) (especially if you can write to the metadata too!)
-
Also, even when I registered the DLL and ran the demo code for a simple metadata lookup where code is at: http://www.autoitscript.com/forum/index.ph...&hl=dsofile http://www.autoitscript.com/forum/index.ph...mp;#entry334794 it failed. I get the folowing message: "Error: Variable must be of type "Object" Which according to these posts (seperate topics... you'll see) [1][2], means to me that something may not be getting set properly. Any ideas? Would someone like to confirm this with autoit 3.2.8.1 ? There's nothing in the bug forum to suggest this is a bug or anything (error after 2 lines of code??). So I'm assuming I'm forgetting something. [1] #141172 [2] #309909
-
Thanks PsaltyDS, still trying to figure that one [how to detect if completed processing a word document] too. <s>The only problem with getting the #of pages from the word document generated is the file hasn't been saved yet, so I don't have a filename to work with while it is generating the word doc from the ppt.<s/> I striked out my comment, since WordAttach includes the option to search for an open word document by window handler.
-
Hey, just so you guys know and because I also went down the path of extracting to get the number of slides, I just found this to maybe be useful: "Dsofile.dll" The Dsofile.dll files lets you edit Office document properties when you do not have Office installed http://support.microsoft.com/?kbid=224351 The Scripting Guys' First Blog : Cleaing Out the Attic: Dsofile.exe: http://blogs.msdn.com/gstemp/archive/2004/02/25/79867.aspx I found out how to do this with autoit3 here: Querying a file's METADATA - AutoIt Forums: http://www.autoitscript.com/forum/index.ph...&hl=dsofile (of course for the future non-vb programmer, here's how to convert vb code to autoit: Help rewriting VBA COM to AU3 - AutoIt Forums: http://www.autoitscript.com/forum/index.php?showtopic=44914
-
I think, perhaps, I should be going about this differently. So let me give background what I've been doing with this thread's information: So I love to print my powerpoint slides with notes through the "File -> Send To -> Microsoft Word - OK > " options. In doing so, Microsoft word opens and a lot of processing happens where slides are injected into MS word into a table and with notes next to it in a column. I absolutely love this functionality. However, and here is my question, how can I detect when this process of preparing the word document is complete? I know there are some commercial products which offer to do handout generation for you, but I just want to detect when the process of preparing a word doc is complete so I can script it with Autoit3. I would like to know if autoit3 vb or something can be used to detect when this process completes. I used process explorer and poked around for a couple of hours to try to see precisely what it was that active when "Send To" is operating, but maybe someone would like to work with me if this is the proper way to do it. Currently, I know I can detect when this is done by: 1. (best idea I know of right now) Monitoring somehow the word doc generation process which got started in powerpoint and seeing when it completes and monitoring an exit code (in case it terminates due to an error not due to natural causes). When it successfuly completes, then move on. (which I detail in my question above) 2. (ok idea) When the word document creation process is complete, the word document goes to page 1. Perhaps detecting when page 1 shows, would tell me. However, what if my powerpoint presentation is less than 3 slides? Then I'll only have a page.... hmm. Problematic... 3. (more crazy of an idea?) Whilst the process is going on, a mouse cursor intermittently shows up as an hour glass and then rescinds into a cursor. 4. (most crazy of an idea?) Perhaps printing slides in powerpoint to postscript, timeing how long that takes, then doing the "Send To - > word" behaviour using the previous printing in powerpoint time and multiplying it by some number to scale.
-
Hey guys, your replies are great. I didn't even know we had word and ppt support like this! I'm still baffled on quickly getting the page number I'm currently viewing in a word document. Like when I'm viewing page 2, for it to tell me I'm on page 2! hmph. Where would I find this? DLL stuff? I found these great postings, but I'm trying for the autoit approach: google search for: +word +document +current +page +number determine page number in Word document - microsoft.public.excel.programming | Google Groups http://groups.google.com/group/microsoft.public.excel.programming/browse_thread/thread/f9b2622167216d7f/f2cc3ee002b994e2?lnk=st&q=%2Bword+%2Bdocument+%2Bcurrent+%2Bpage+%2Bnumber&rnum=7#f2cc3ee002b994e2 Insert current page number "Page X of N" on a word document - MSDN Forums http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=274470&SiteID=1 I could look into how autoit works with vba: finding out current page number - microsoft.public.word.vba.general | Google Groups: http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/9864bb16ee79f8a7/ff21f63fb79f01f7?lnk=st&q=%2Bword+%2Bdocument+%2Bcurrent+%2Bpage+%2Bnumber&rnum=16#ff21f63fb79f01f7
-
Hello, Instead of making a couple topics for each question individually, and since they have some grouping in subject matter, I have grouped them in this post. I hope that's ok, though I can seperate posts if necessary. 1. How do I detect how many slides are in a powerpoint show? I know in powerpoint's slide properties, I can get slide "Statistics" but I'm wondering if there's a simple way to send a query to a slide file or an open slide and get a response back (even if I have to parse it) without having to do some gui controls (click, select, use menus, etc). 2. How do I detect the number of pages in a word doc? The following link shows how to do so using windows scripting however I'm wondering how best to do this by querying the document perhaps through autoit. http://www.microsoft.com/technet/scriptcen...06/hey0907.mspx Again, like above in #1, I know properties has this option but perhaps there's a smart way to do this. 3. How do I detect what page # I'm on in an open word document? I am currently planning on perhaps reading the pixel at the bottom of the screen to the left which indicates page number, but perhaps there is a better way. (as that might take some gymnastics and figuring out how to deal with multinumber pages [ex: page 1 vs. page 11, vs. page 10, etc... yuck) 4. How to know how much time remains until a screensaver loads? This might be tricky. Searching through the forums hasn't provided me substantial results just yet. Why: Would like to know how to determine if screen saver is on or not. I suppose I can ward off a screensaver by moving a mouse around. Any ideas or best practices are welcome!, Krystian.
-
Send keys to minimized window
krystian replied to krystian's topic in AutoIt General Help and Support
Thanks for taking this a step further with the code you released. I was able to learn from it. =) -
Send keys to minimized window
krystian replied to krystian's topic in AutoIt General Help and Support
Thanks. =) I mainly built off the code offered at this site: http://www.outlookcode.com/threads.aspx?fo...messageid=16295 I found a workaround to the problem of minimizing outlook. Though, thanks! I would love to review how you did the COM solution. I'm a novice to the VS.Net development platform so I figured out how to get started and found how to execute a button through the COM. But I wasn't able to figure out how to execute the "Send/Receive" button in outlook from another application alltogether. -
Send keys to minimized window
krystian replied to krystian's topic in AutoIt General Help and Support
For anyone visiting, here's the final code that I settled with to do send and receive in outlook. ; Notes: ; 1. I couldn't send commands to Outlook when it was minimized, therefore, you'll see my transparency ; modification of the outlook window, so the user won't have to see Outlook load. ; 2. I use ControlSend(), because Send() doesn't work when the desktop is locked. ;Here's what this method does: ; If Outlook exists, do the following: ; - Set the transparency to 0, so that when I activate the window, nothing shows up ; - Activate outlook... nothing should show up ; - Send send/receive command. I used ControlSend, because I found this worked when the desktop was locked. ; - Hide the window, THEN do transparency modification, ; so that when you minimize, you don't see anything (the taskbar icon minimizing)... ; .. this way you adjust properties of outlook without having outlook flamboyantly open on your desktop. ; - Finally minimize outlook while it's hidden... therefore, no taskbar icon shows up minimizing outlook. WinWait($ol_title) WinSetTrans ($ol_title, "", 0) WinActivate($ol_title, "") ControlSend($ol_title, "", "Standard", "{F9}");Works when desktop is locked WinSetState($ol_title, "", @SW_HIDE);When you hide then minimize... you don't see the application minimize WinSetTrans ($ol_title, "", 255) WinSetState($ol_title, "", @SW_MINIMIZE) -
Send keys to minimized window
krystian replied to krystian's topic in AutoIt General Help and Support
Hey, I just recently returned to this and I was able to get ControlSend to effect Send/Receive in Outlook! After sort of writing a COM object inspired by the link below, out of curiosity I came back to AutoIt3 to see if I could use the "Standard" commandBar (which I overlooked/didn't see before until now) http://www.outlookcode.com/threads.aspx?fo...messageid=16295 This idea was inspired by this line: Set oCB = _ oOutlookApplication.ActiveExplorer.CommandBars("Standard") So with some tweaking and experimentation, I found the following lines of code can emulate if you pushed F9 at the Outlook window: $ol_title = "- Microsoft Outlook" ControlSend($ol_title, "", "Standard", "{F9}") Thanks for your help! I'm trying to see as a proof of concept whether I can externally send commands to Outlook widgets. Outlook can send/receive on it's own, I just want to dictate externally when to do so and have granularity to instruct outlook to do all sorts of things in the future starting from this. I don't want to switch between offline mode/online mode in Outlook (I don't use exchange), or permit outlook to do a send receive when I start outlook (because sometimes I want to load outlook and type up and send out emails before I get new ones). I also don't want outlook to check email every specified certain interval of time, unless I set it through the windows Scheduler. The reason being I can't configure within outlook to check email at say, 7 AM, 5 PM and 9 PM every day. Just an experiment I'm doing. It's tied in to looking at optimizing my use of my email client. -
How are the WinWait family of functions implented? WinWait, WinWaitActive, WinWaitNotActive WinWaitClose accomplish their task of knowing whether a window exists, is active, or has been closed? When an au3 script is running, does the script poll windows some interval of time or is some event fired every time a new window action happens (like get focus, close, new window created) and the script parses and listens? [perhaps there's some windows hook that permits this somehow] Just out of curiousity.