Jump to content
zetaimmersion

PowerPoint/Outlook COM objects

Recommended Posts

zetaimmersion

Hi all. 

I am trying to do 2 things but i cannot seem to get any traction on how to read/implement this idea.

Premise: PowerPoint file in C\temp\presentation.pptx that contains on the first slide 2 entries as "<one>" and "<two>" which need to be replaced with "user1" and "user2", then a silent Outlook send mail containing the file with a predefined body and subject.

I narrowed it down to COM objects as the Office does not like intrusive open AutoIt functions. I installed OLE/COM Object Viewer to understand how to create the commands but i am still stuck. So far i am trying to user water's code but i suck

COM object i was originally trying to modify

Dim $oPPT, $oPres

$oPPT = ObjCreate("PowerPoint.Application")
$oPPT.Visible = True
$oPres = $oPPT.Presentations.Read

Water's code below (0.1% modified)

#include <File.au3>
#include "PowerPoint.au3"
#include <misc.au3>

Global $sFile = "C:\temp\presentation.pptx"

Global $sString2Search = "<username>", $sString2Replace = "Password", $iReplaceOnce = 1, $sFullLogFile = "C:\temp\pptxlog.txt"

_ProcessPpt($sFile)

Func _ProcessPpt($sFile)

    $oApp = _PPT_PowerPointApp()
    Local $bChange = False
    Local $oInterface = $oApp.Presentations
    Local $oPresentation = $oInterface.Open($sFile, False, False, False)
    If @error Then
        _FileWriteLog($sFullLogFile, "E Error " & @error & " opening File " & $sFile)
        Return SetError(1, 0, 0)
    EndIf

    ;it does not even open my file and from here not sure how to read the text and replace it

EndFunc   ;==>_ProcessPpt

 

Share this post


Link to post
Share on other sites
water

The Outlook part can easily be done using my OutlookEX UDF (for download please see my signature).
The PowerPoint part can be done with the (yet unfinished) PowerPoint UDF. Some manual coding might be needed (for download please see the example scripts section of the forum).

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I need to open the attachments from mails without downloading them. Is it possible using OutlookEx UDF ?
    • water
      By water
      Extensive library to control and manipulate Microsoft Outlook.
      Theads: Development - General Help & Support - Example Scripts - Wiki
      BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort

      KNOWN BUGS (last changed: 2018-01-26)
      None
    • Bilgus
      By Bilgus
      ; NetFirewallPolicy2 COM UDF Library for AutoIt3
      ; AutoIt Version : 3.3.14.5
      ; Description ...: Windows Firewall Policy2 Interface, Provides access to the firewall policy for Windows Vista+
      Including Test Script 
      UDF:
      Test Script:
       
    • Bilgus
      By Bilgus
      I was Playing around With AutoIt this evening and wondered how hard it would be to get typeinfo like the COM Viewers do only using AutoIt
      Turns out it was pretty easy.
      A Few Notes:
      CAarray info is unfinished I didn't have any objects to test it on so I left it Limited.
      The Object must have IDispatch exposed (ITypeInfo is derivative)
      Its Just a proof of concept Run with it but don't carry scissors
      ITypeInfoCOM.au3
      ITypeInfoTest.au3
       
      Output IWebBrowserApp
       
      Output ObjCreate(MediaPlayer.MediaPlayer.1)
       
    • Gowrisankar
      By Gowrisankar
      Dear members,
      I'm trying to get the attachments from mails using OutlookEx UDF and then save them in a particular location.
      The UDF considers even the signature images and other images in the mail body as attachments, and saves it in the folder I point. I want only the proper attachment documents to be saved.
      Requesting the guidance of the forum members.
       
       
      Thanks and regards,
      Gowrisankar R.
×