0

Following code works;

Dim ExcelApp As Excel.Application
ExcelApp.Visible = False

Following code doesnt work;

Dim OutlookApp As Outlook.Application
OutlookApp.Visible = False

Do you have any idea why excel could be invisible but outlook is not?

1 Answers1

0

If you simply create an instance of the Outlook.Application object, it will be invisible (e.i. no Explorers or Inspectors). Keep in mind that once the last Outlook window is closed, it will shut itself down even if your code has an outstanding reference to any of its objects (unless it is an Explorer or an Inspector object).

What exactly are you trying to achieve?

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • I first display Inspector then paste picture into Inspector. But I dont want user is able to see what I am doing... –  Mar 10 '16 at 23:29
  • Are you just trying to use the Word editor? All you need is MailItem.GetInspector.WordEditor. – Dmitry Streblechenko Mar 11 '16 at 01:22
  • Are you trying to create an HTML message with an embedded image? – Dmitry Streblechenko Mar 11 '16 at 05:31
  • 1-Copy any picture from your computer. 2- Open outlook. 3- Open inspector. 4- Paste that picture 5- Send mail. The question is how to paste picture without displaying the inspector. –  Mar 11 '16 at 05:49
  • See http://stackoverflow.com/questions/17195207/including-pictures-in-an-outlook-email – Dmitry Streblechenko Mar 11 '16 at 14:15
  • Thank you but your advice is about adding image with attachment, I am looking for adding image directly like copy/paste... –  Mar 12 '16 at 07:10
  • Outlook never stores images inside the body, they are always stored as attachments, both in HTML and RTF formats. The message body simply links to the attachments. – Dmitry Streblechenko Mar 12 '16 at 20:03