Listview from GUI to Email

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Crashm87
Posts: 48
Joined: 25 Jul 2016, 13:12

Listview from GUI to Email

30 Jan 2018, 15:50

Hello Forum,

Wondering if anyone can lend a helping hand. I have wrote a script I use to keep a simple database to keep track of information from incoming calls at work. (vs standard pen and paper). It all works great so far relying heavily on the forums for CSV help and functions.

Now I'm wondering if there is a way to send my listview of the CSV file to email. Essentially, being able to send a 'call log' to my boss daily. I have a portion of the script from the forum here that brings my entire CSV file to a GUI with a listview. But I cannot highlight all cells, or copy from it.

Here is pic of my list - https://imgur.com/bncBDK9

I want that general layout over to an email, so the recipient can also view it in a listview, vs a CSV file.

Any help is appreciated
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Listview from GUI to Email

09 Feb 2018, 15:26

Of course, but it would help if you are able to share your script so that we'd be able to show you how to export your list from your specific script...
Albireo
Posts: 1750
Joined: 16 Oct 2013, 13:53

Re: Listview from GUI to Email

09 Feb 2018, 17:28

I would use the program .: Blat mail. Here is some information about use of Blat command line emails blat
There are a number of other pages that also describe the function of Blat
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Listview from GUI to Email

10 Feb 2018, 01:44

If you use Outlook then you could use COM to create a table in an email. It is not that difficult (if you know all the secret words and magic numbers).

Here is a basic example of creating a table in an Outlook email:

Code: Select all

olApp := ComObjActive("Outlook.Application")
olMailItem := olApp.CreateItem(0) ;  olMailItem := 0
olMailItem.Display

olMailItem.HTMLBody := "<b>Stuff Before</b>"

wdDoc := olMailItem.GetInspector.WordEditor
olTable := wdDoc.Tables.Add(wdDoc.Range(wdDoc.Range.End - 1), 6, 7, 1, 0) ; Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior
olTable.Cell(1,1).Range.Text := "First Cell"
olTable.Cell(3,2).Range.Text := "Three Down, Two Over"

olMailItem.HTMLBody := olMailItem.HTMLBody "<i>More Stuff</i>"
This assumes Outlook is running and it only displays the email and does not actually send it. It is also easy to start, hide, send, etc. with Outlook through COM.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Albireo
Posts: 1750
Joined: 16 Oct 2013, 13:53

Re: Listview from GUI to Email

10 Feb 2018, 05:16

What is needed to use Outlook, if I want to test your example above?
(Do I need an Outlook account? Office package? or...)
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Listview from GUI to Email

11 Feb 2018, 01:45

Albireo wrote:What is needed to use Outlook, if I want to test your example above?
(Do I need an Outlook account? Office package? or...)
You need Outlook installed on your computer. That usually means Microsoft Office although it is possible to just install Outlook.

And since I used ComObjActive("Outlook.Application") you need to have Outlook actually running. Although that could easily be changed to ComObjCreate.

All the Office products have COM access which makes them easy to automate. For that matter most Microsoft products have COM access including Windows. It was designed by Microsoft after all to allow their products to communicate with each other.

A lot of other high-end software also adopted Microsoft's COM protocols for their products.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Albireo
Posts: 1750
Joined: 16 Oct 2013, 13:53

Re: Listview from GUI to Email

11 Feb 2018, 10:00

Thank you!
Searched around, but did not find Outlook for free, Outlook Express seems to be free, but will Outlook Express work with ComObj? ( I haven´t MS Office on this computer)
A new mail client has appeared on Windows 10. it's just called "e-post" on Swedish (Maybe e-mail on english?) is this the same as Outlook?
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Listview from GUI to Email

12 Feb 2018, 14:22

Albireo wrote:Thank you!
Searched around, but did not find Outlook for free, Outlook Express seems to be free, but will Outlook Express work with ComObj? ( I haven´t MS Office on this computer)
A new mail client has appeared on Windows 10. it's just called "e-post" on Swedish (Maybe e-mail on english?) is this the same as Outlook?
I doubt you are going to get a ligitamite version of Outlook for free that supports COM.

Outlook Express I don't believe supports COM.

Windows Mail that comes with Windows 10 does not seem to use COM. Windows Mail basically replaced Outlook Express as the free email app for Windows. Windows Mail seems to use the .NET framework. I imagine you could send emails using .NET and you can access .NET through AHK but I have never seen a specific example of sending emails this way.

I pretty much always can count on Outlook being on the computers I deal with so I am no expert on the best way to send emails without Outlook.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Google [Bot], Joey5, Nerafius, Rohwedder, Tvlao and 140 guests