Search found 1905 matches

by FanaticGuru
Today, 20:02
Forum: Ask for Help (v2)
Topic: How to format a paragraph of MS WORD document Topic is solved
Replies: 10
Views: 159

Re: How to format a paragraph of MS WORD document Topic is solved

How to format a paragraph of MS WORD document, I want to format the last paragraph use the previous paragraph's font type and size. If you want to copy all the formatting from the paragraph above instead of just the font and size, you can do this: oWord := ComObjActive("Word.Application") f11:: { o...
by FanaticGuru
Today, 19:43
Forum: Ask for Help (v2)
Topic: Variadic function with * as the final parameter (without a parameter name) Topic is solved
Replies: 5
Views: 52

Re: Variadic function with * as the final parameter (without a parameter name) Topic is solved

Maybe an example will help: testFunc(1,2,3,4,5,6) testFunc(a, b, *) ; all parameters passed after the first two are discarded { MsgBox a ' ' b } testFunc2(1,2,3,4,5,6) testFunc2(a, b, c*) ; all parameters passed after the first two are stored in the array c { MsgBox a ' ' b for stuff in c MsgBox stu...
by FanaticGuru
Today, 17:43
Forum: Ask for Help (v2)
Topic: syntax for map
Replies: 9
Views: 173

Re: syntax for map

@teadrinker Was not aware of the use of * with maps. Thanks. It is more of * with any array in any function thing. * just 'expands' an array and tells a function that elements are to be treated as separate parameters resulting in a variadic function call. Arr := ['StringThing', 7, 6] Msgbox SubStr(...
by FanaticGuru
14 Mar 2024, 13:59
Forum: Ask for Help (v2)
Topic: Overriding other app's window style without a flash
Replies: 3
Views: 108

Re: Overriding other app's window style without a flash

I see, then I guess I'd also need to implement all the logic inside that DLL file. Do you know whether it's actually possible, though, not to only apply styles, but update window size/position, and, crucially, do all that before a window is shown? Yes, the SetWinEventHookEx approach is doable, but ...
by FanaticGuru
13 Mar 2024, 17:22
Forum: Ask for Help (v2)
Topic: Overriding other app's window style without a flash
Replies: 3
Views: 108

Re: Overriding other app's window style without a flash

Maybe somehow hook into the window creation instead of waiting for the window to be created and changing the styles later? You can hook into a AHK window before it is displayed but not another application's window before it opens without using a separate custom DLL file. It is the difference betwee...
by FanaticGuru
23 Feb 2024, 19:22
Forum: Ask for Help (v2)
Topic: Open PDF using ComObject
Replies: 8
Views: 264

Re: Open PDF using ComObject

:*:yyyy:: { AcroApp := ComObject('AcroExch.App') AcroAVDoc_Active := AcroApp.GetActiveDoc() AcroPDDoc_Active := AcroAVDoc_Active.GetPDDoc() AcroPDDoc_Merge := ComObject('AcroExch.PDDoc') AcroPDDoc_Merge.Open(A_Desktop '\CheckIn.pdf') MsgBox AcroPDDoc_Active.GetFileName '`t' AcroPDDoc_Merge.GetFileN...
by FanaticGuru
22 Feb 2024, 13:32
Forum: Ask for Help (v2)
Topic: Open PDF using ComObject
Replies: 8
Views: 264

Re: Open PDF using ComObject

Thanks again, FG. I'm still not sure why the script isn't working on my end. If I add in an "OpenAVDoc" line it'll successfully open the doc trying to be inserted, so everything around it seems to be working. I think the "InsertPages" command might be failing, but I still haven't pinpointed what th...
by FanaticGuru
20 Feb 2024, 21:34
Forum: Ask for Help (v2)
Topic: Open PDF using ComObject
Replies: 8
Views: 264

Re: Open PDF using ComObject

For some reason the second script for merging didn't work. It's not merging and it's also not opening the second document (the Test document). I've tried both the verbose and the condensed versions. Any idea why? You mentioned there is a way to merge without opening the second document. Is this scr...
by FanaticGuru
20 Feb 2024, 15:33
Forum: Scripts and Functions (v2)
Topic: [Class] GuiReSizer - Position and Resize Gui Controls
Replies: 27
Views: 5445

Re: [Class] GuiReSizer - Position and Resize Gui Controls

I added a second ListView it doesn't show guiList.ListView := guiList.Add("ListView", "section +Grid -Multi xm r20 w750", ["This", "That", "Other"]) guiList.ListView.Function := ListView_Columns ; Call Custom Function to Adjust Column Width guiList.ListView.Width := -10 ; 10 from Left Margin guiLis...
by FanaticGuru
19 Feb 2024, 18:44
Forum: Ask for Help (v2)
Topic: Open PDF using ComObject
Replies: 8
Views: 264

Re: Open PDF using ComObject

Here is a script that merges a PDF from a file at the beginning of the active PDF. ; Insert file PDF at the beginning of currently active PDF ; Verbose F12:: { AcroApp := ComObject('AcroExch.App') AcroAVDoc_Active := AcroApp.GetActiveDoc() AcroPDDoc_Active := AcroAVDoc_Active.GetPDDoc() AcroPDDoc_Me...
by FanaticGuru
19 Feb 2024, 15:56
Forum: Ask for Help (v2)
Topic: Open PDF using ComObject
Replies: 8
Views: 264

Re: Open PDF using ComObject

I'm trying to do a seemingly easy action of just opening a specific PDF, but I can't seem to get it to work. Here is code to open a PDF in Acrobat: PDDoc := ComObject('AcroExch.PDDoc') ; create new document object PDDoc.Open(A_Desktop '\Test\Test.pdf') ; open document AVDoc := PDDoc.OpenAVDoc('') ;...
by FanaticGuru
15 Feb 2024, 20:43
Forum: Scripts and Functions (v2)
Topic: Compose an Outlook Email with an embedded picture
Replies: 3
Views: 170

Re: Compose an Outlook Email with an embedded picture

#Requires AutoHotkey v2.0 #SingleInstance Force UniquePictureId := "MyUniquePictureName" PathToPicture := A_ScriptDir "\P01132.jpg" olMailItem := 0 o:= ComObjActive("Outlook.Application").Session() MailItem := ComObjActive("Outlook.Application").CreateItem(olMailItem) MailItem.TO :="recipient@email...
by FanaticGuru
06 Feb 2024, 14:42
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 25969

Re: Snipper - Window Snipping Tool

I just included OCR extention into my Snipper main script but get below error Any of the extension need to be included in a very specific way as described in the post with the extensions. Each of these files can be added to Snipper by including them in the same directory as the Snipper script and t...
by FanaticGuru
02 Feb 2024, 14:48
Forum: Ask for Help (v2)
Topic: Call function from class instance variable
Replies: 4
Views: 279

Re: Call function from class instance variable

Do you have any idea how I can assign a code-block including control structures (if, loops, etc) like in my 2nd post as an anonymous function to a variable? Fat Arrow anonymous functions cannot do loops, but they can do if-statements through a ternary operator. class TestClass { x := (_) => (MsgBox...
by FanaticGuru
01 Feb 2024, 19:54
Forum: Ask for Help (v2)
Topic: Call function from class instance variable
Replies: 4
Views: 279

Re: Call function from class instance variable

How can I call a function stored inside a class instance variable? class TestClass { x := () => MsgBox("x") y := "y" z { get { return this.x } set { this.x := value } } f() { this.x() } } a := () => MsgBox("a") a() test := TestClass() ;OK MsgBox(test.y) ;OK test.x() ;Error: Too many parameters pass...
by FanaticGuru
30 Jan 2024, 18:02
Forum: Ask for Help (v2)
Topic: working with attachments in outlook
Replies: 10
Views: 636

Re: working with attachments in outlook

FanaticGuru's suggestion for how to remove embedded attachments would probably work for deleting the signature images too. However, the code below just looks for files that end in "pdf". If you need to work with image files that cannot be separated from embedded images by their extension, here is a...
by FanaticGuru
26 Jan 2024, 21:10
Forum: Ask for Help (v2)
Topic: working with attachments in outlook
Replies: 10
Views: 636

Re: working with attachments in outlook

The files are saved to disk (I do not think they can be sent without first being saved; someone could prove me wrong on that). One option for copying attachments to a new email without saving the attachments to a file first is to forward the email. olApp := ComObjActive("Outlook.Application") olEma...
by FanaticGuru
24 Jan 2024, 17:22
Forum: Ask for Help (v2)
Topic: Shortest way to define a 2D Map
Replies: 8
Views: 486

Re: Shortest way to define a 2D Map

I use this Prototype code to make working with multidimension maps much easier. ; Helgef: An "n-dimensional" map; ntepa: Map.Prototype Class; FanaticGuru: fat arrow Function ; https://www.autohotkey.com/boards/viewtopic.php?p=520860#p520860 MapN() => (__set := Map.Prototype.GetOwnPropDesc("__Item")....
by FanaticGuru
24 Jan 2024, 15:49
Forum: Ask for Help (v2)
Topic: How to move Word cursor? Topic is solved
Replies: 6
Views: 400

Re: How to move Word cursor? Topic is solved

If you think there's no way to move the cursor to the current view using COM or any other methods, I'll give up. I just said that it cannot be done fully with COM. The "any other method" is fairly easy. You just simulate a click in the active Word window. You do not have to actually move the mouse ...
by FanaticGuru
24 Jan 2024, 14:17
Forum: Scripts and Functions (v2)
Topic: AHK Startup (Consolidate AHK Scripts' Tray Icons)
Replies: 20
Views: 3261

Re: AHK Startup (Consolidate AHK Scripts' Tray Icons)

@Jasonosaj Even if you can add menus to mainscript How do you make other scripts execute mainscript menu commands Then you may have to modify all the sub scripts. Yes, adding another scripts tray menu to AHK Startup's tray menu is next to impossible. When this script starts another script, the othe...

Go to advanced search