UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Embed OLE Object, Office 2013    
 
   
yvesdekort
post Jun 2 2020, 09:22 AM
Post#1


UtterAccess VIP
Posts: 1,958
Joined: 9-August 01
From: Belgium


Hi,
I'm creating a task in Outlook from within Excel using vba.
But is it possible to embed an OLE-object (it's a pdf) into the body of the task?
Code so far:
CODE
</div><div>
</div><div>Set objOutlookApp = CreateObject("Outlook.Application")
Set objTask = objOutlookApp.CreateItem(oltaskitem)

Sheets("Bestelbon").Select
objTask.Subject = Range("i5").Text + " - " + Range("b7").Text
objTask.StartDate = Now
objTask.Status = olTaskInProgress
objTask.Body = Cells(16, "A") & vbNewLine
objTask.DueDate = Range("i7").Text
objTask.Display

</div><div>
</div><div>


--------------------
Yves

Don't worry, just panic!!!
Go to the top of the page
 
DanielPineault
post Jun 2 2020, 11:03 AM
Post#2


UtterAccess VIP
Posts: 7,383
Joined: 30-June 11



Don't see why you could use https://docs.microsoft.com/en-us/office/vba...Attachments.Add

Perhaps something like (untested)

CODE
objTask.Attachments.Add "C:\...\...\filename.ext", olEmbeddeditem

--------------------
Daniel Pineault (2010-2020 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    9th July 2020 - 05:41 AM