Quantcast
Channel: Outlook for Developers forum
Viewing all 6421 articles
Browse latest View live

How to save a Word File with local hyperlinks as PDF, with a functioning hyperlink on the PDF document.

$
0
0

How to link local documents (such as text file, pdf) in word so that after saving it as pdf, when the hyperlink is clicked the file opens up properly.

I want to add a hyperlink for a text file, which is in the same directory under a folder called “attachment”, if I click a hyperlink in a word document, it opens the file properly, and I want to do the same with a pdf document. How do I accomplish this?




Closing a FormRegion without Prompting to Save

$
0
0
How do we signal Outlook that a FormRegion may be closed without promoting the user to Save?

 

We’ve developed an Outlook 2010 COM AddIn using VSTO and VS2012 and it contains several forms. Users activate these forms from Custom Ribbon Button Clicks.  In the event handler(s), we Add a new item to the Inbox using the appropriate form’s Message Class. Most forms are blank.  If the user simply closes the form, some of them prompt to save, while others do not.

 

What triggers the need to ask the user to save a form message prior to closing? The MailItem.Saved() property appears Read-Only.

GetSMTPAddressForMailSender(MailItem mail) results in "property http://schemas.microsoft.com/mapi/proptag/0x39FE001E" is unknown ..."

$
0
0

Hi,

This might be an exchange issue because I didn't face it in all the exchange 2010 servers I worked with...
Anyway ...my outlook 2010 plugin calls 
GetSMTPAddressForMailSender(MailItem mail).
When doing so I get the error below

=============================06 - 17:43:38.022================================++++++++++++++++++Error Message:++++++++++++++++++System.Runtime.InteropServices.COMException (0x8004010F): The property "http://schemas.microsoft.com/mapi/proptag/0x39FE001E";; is unknown or cannot be found. at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName) at OutlookAddIn1.GlobalFunctions.GetSMTPAddressForMailSender(MailItem mail) in C:\Private_Files\Development\WorkMail\LocalRepo\WorkMail\WorkMailAddin\GlobalFunctions.cs:line 98+++++++++++++++END Error Message++++++++++++++++++


Which event fire when save the outlook message or its atachment?

$
0
0

Hi Everyone,

I want to handle a event, when user save the attached file(In outlook mailitem) in hard disk or somewhere else

then which event will be fire to identify the attachment is saving or mailitem is saving?

I want to fire a event when a attached file is saving.

Outlook 2007 Font

$
0
0

I have a macro that creates a Calendar Event for selected contacts, and in the body of the Calendar Event, it shows words from certain fields of each Contact selected.  

So for example, the field of the Contacts which is the FullName of each Contact, the full name of the Contact shows up as to each Contact selected.

Is there a way to add to the macro so that the words coming from the FullName field can be designed as a font that would be Times New Roman 14, Color Blue, Bold and Underlined Bold?  And it's not be selecting the words and changing font…it is simply automatic when it shows up in the Body field.

So there is the standard code lines that come with it, and  here is the basic code lines that does what I said above :

Dim strDynamicDL2 As String

strDynamicDL = strDynamicDL & objItem.FullName & (";")

With itmAppt.Body

itmAppt.Body = strDynamicDL2

  End With

Search by Time Range

$
0
0
Hi all,

I've been searching for a while but I could not find a solution.

I would like a way (any way, using VBA or not) to search mesages on Outlook 2011 filtering using only a time range.

For example, I would like to find ALL messages, from ANY day that were received before11 AM OR after 4 PM.

Please, anyone could suggest a way to do this search? I am able to use VBA, C# and other technologies, but I just could not figure out a way to do that. If the advanced Outlook filter can do that it would be perfect, but I think it not work this way.

Any help will be appreciated, thank you in advance and best regards for all!

Outlook Inspector.WordEditor is Nothing

$
0
0

I developed a desktop app in Visual Basic 2010 in which users can send an emailmessage to recipients selected from a list of tennisclub members. This app was created on a Vista machine with Office Professional 2007 (both EN) and has been around for nearly two years. It always worked flawlessly on different user machines. I am now developing on Windows 8.1 Pro + Office Professional Plus 2010 (both NL). Because of some minor database changes I modified the code but did not touch the part where the mailmessage is created and its properties are set. The code that adds an image to the mailitem body all of a sudden throws exceptions. It boils down to the Inspector.Wordeditor returning nothing. I have also a machine with Windows 7 Home Premium + Office Professional Plus 2010 and there I see the same behavior = problem.

I have seen a lot of similar reports on this and other forums but none really gives me a real solution to my problem. I my app I first check whether Outlook is already active and make sure Word is available. These parts works OK. My code is:

Imports ol = Microsoft.Office.Interop.Outlook
Imports wd = Microsoft.Office.Interop.Word

Dim appOL As Object
On error Resume Next
appOL = GetObject(,"Outlook.Application")
If err.Number <> 0 Then appOL = CreateObject("Outlook.Application")
On error goto 0
Err.Clear()

Dim olItem as ol.MailItem
Dim olNS as ol.NameSpace
Dim olDrafts as ol.MAPIFolder
Dim olExplorer as ol.Explorer
Dim olInsp as ol.Inspector
Dim olDoc as wd.Document
Dim olSel as wd.Selection
Dim olRecips as ol.Recipients
Dim olRecip as ol.Recipient

olNS = appOL.GetNamespace("MAPI")
olDrafts = olNS.GetDefaultFolder(ol.OlDefaultFolders.olFolderDrafts)
olExplorer = olDrafts.GetExplorer
olItem = appOL.CreateItem(ol.OlItemType.olMailItem)
With olItem
  .To = "..."
  .BCC = "..."
  .Subject = "..."
  .BodyFormat = ol.OlBodyFormat.olFormatHTML
  .Body = "..."
  ...
  ...
  .Display(False) ' Necessary to get the Inspector
  My.Resources.DP_MailHeaderImage.Save("C:\Tmp\DP_MailheaderImage.jpg")
  olInsp = .GetInspector
  If olInsp.IsWordMail = True and olInsp.EditorType = ol.OlEditorType.olEditorWord Then
    olDoc = olInsp.WordEditor
    olDoc.Shapes.AddPicture("C:\Tmp\DP_MailheaderImage.jpg", SaveWithDocument:=True)
    *** AT THIS POINT THE EXCEPTION IS THROWN BECAUSE olDoc = Nothing ***
  End if

I would appreciate if anyone could throw a light on why this is failing now although it did work previously

Thks beforehand
Ruud van der Spoel

 

Outlook.MailItem PropertyChange BodyFormat

$
0
0

Hallo,

If the BodyFormat in a MailItem is changed by the user the event PropertyChange will not fired. Some other changes like "Importance" or "OriginatorDeliveryReportRequested" are working correct. But how can I handle the event if the BodyFormat is changed e.g. from HTML to RTF?

My code:

OutlookItem olItem = new OutlookItem(inspector.CurrentItem);
if (olItem.Class == Outlook.OlObjectClass.olMail)
{
    m_Mail = olItem.InnerObject as Outlook.MailItem;
    m_Mail.PropertyChange += m_Mail_PropertyChange;
}

...

private void m_Mail_PropertyChange(string Name)
{
    //do something...
}

Andreas

'Unsubscribe' button in email that creates an Outlook / Exchange auto-rule for the recipient to hide your future emails.

$
0
0

Is there a way using custom forms or macros, to add an 'Unsubscribe' button to my inter-departmental email newsletter that will auto create a filter/rule on the recipients computer when they open up my email and click the 'Unsubscribe' button? In my company we have a few thousand employees, everyone uses Outlook and we have company Exchange email accounts.

In other words, it is easy enough to create a rule for ourselves so that if we don't want to see the frequent emails from a co-worker about their never ending project that has nothing to do with us, then we can in Outlook, and it is automatically put in your deleted folder in Outlook, the rule saved to our company exchange server and we never see those annoying emails again.

Couldn't that functionality be used to share the ability to easily filter the emailsyou send to others -a sort of 'unsubscribe' for your interoffice emails? They won't really be unsubscribed, more like'Hide my newsletter emails from now on' but if they never have to see them again it's just as good -and this way no one has to manage a distribution list! Most of the employees in my company don't know how to create filtering rules, and if they can just click an 'Unsubscribe' button, then they won't have to.

Possible? Not possible? A dumb idea?

I am almost positive this is a bug in Outlook 2010

$
0
0

Hi,

My VBA script runs every time without abending... but it leaves one item "first incoming item to the Inbox" unprocessed.  

I receive my faxes to my outlook email box... each email has a PDF attached to it that through my VBA script I will strip the PDF file and move it to folder in C drive... I have defined the rule start the script as the email are coming in.  Problem I have when I start the Outlook, if there comes in say 75 item emails, except the first one all other 74 will be processed correctly and rules stops... To force the missing item to be stripped of the PDF I have to manually run the rules again myself then close the Outlook...

I am sure this is bug in Outlook because my script runs with no problem... Could you help me...   


Jeff Paarsa

C# Outlook AppointmentItem - update the RTFBody with regular text

$
0
0

Hey,

I want to update the body of the sent email - I want to add some text to the end of the body of the email. it is easy to add the text if I update the AppointmentItem.Body - but sometimes, the body is formatted (RTF) and I don't want to loose the formatting - what is the best way to add text to the end of the RTFBody?

for example, I want to add the string: Bla Bla Bla Bla

How can I do it?

and what if I want to find and replace a text in the RTFBody?

Thanks,

Outlook form to Excel

$
0
0

Guys,

I need some help to export an Outlook form to Excel. There are a bunch of people that fill this form. It means that a receive a lot of the same forms.

I have already discovered the name of all form controls that this form has. Because I did not create it, but my company did. Anyway, I need to grab all those information and put on Excel.

I am trying to use this code - to get information of emails it works very well.

I appreciate the attention with the case.

                                                                                                                                                                                                                                                                                 

Sub Em()


Dim myOlApp As Outlook.Application
Dim mpfInbox As Outlook.MAPIFolder
Dim obj As Outlook.MailItem
Dim Sd As String
Dim Lh, Rq
Dim i As Integer


    Set myOlApp = CreateObject("Outlook.Application")
    Set mpfInbox = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("Form")

 ' Loop all items in the Inbox\Test Folder
        Tmail = mpfInbox.Items.Count

    For i = 1 To Tmail

        If mpfInbox.Items(i).Class = olMail Then

            Set obj = mpfInbox.Items.Item(i)

               If obj.Subject = "Sales Rep Check List for Revenue Deals" Then
'Thats the hard part. BY the way, that is the name of my form.

'Form ("Sales Rep Check List for Revenue Deals").



               Sheets(1).Cells(1, 1) = h




                Else




                    End If




               End If


       Next


End Sub

Need to select non default email account

$
0
0

Hi,

In an outlook 2010 set up I have connected multiple email accounts to a single Outlook, from Yahoo, Hotmail and Att etc... each account have their own boxes data and work independently... I have a VBA Script that should only run on a single account as the emails are coming in... So I use:

Set objFolder = ns.GetDefaultFolder(olFolderInbox)  to get to the inbox...

Problem is if I change the Default email to another email account, My VBA script does not run... Any idea how I can select Inbox of a None Default email on an Outlook that is handing multiple email accounts?

Regards,

Jeff P.


Jeff Paarsa

Customize context menu using VBA in Outlook 2013

$
0
0

I use the code below at ThisOutlookSession class in Outlook:

Private WithEvents mobjCommandBars As Office.CommandBars
Private Sub Application_Startup()
  Set mobjCommandBars = ActiveExplorer.CommandBars
End Sub

Private Sub mobjCommandBars_OnUpdate()
  Dim objCommandBar As Office.CommandBar
  
  Set objCommandBar = ActiveExplorer.CommandBars("xxx")
  '...code to add custom control on command bar
End Sub

I want to add custom controls when I right click in a Mail Item on Outlook's Explorer, so my idea is to handle OnUpdate event of CommandBars to create my custom menu.

The problem I'm having is that I searched and looped for the entire ActiveExplorer.CommandBars collection and didn't find this context menu.

Is this possible using VBA and Outlook 2013 or I'll have to use Visual Studio?


Felipe Costa Gualberto - http://www.ambienteoffice.com.br

How do I create calendar entries for tasks?

$
0
0
I would like to create calendar entries and reminders for recurring tasks. So if I have a task coming up I would like to see an entry in the calendar to show when I have to do it.

Outlook 2013 Mail Setup seems to require that all dependencies of a MAPI provider are in system32

$
0
0


I have an Outlook MAPI addin, which works in Outlook 2010, but not in 2013.  Part of the setup requires users to configure a MAPI email account (control panel -> mail-> E-mail Accounts -> New -> Other -> <our product>)  The primary DLL used by the control panel is stored in the system32 directory, and all of it's dependencies are stored in "C:/Program Files/Common Files/<product>/", and that folder is in the $PATH environment variable.  

If I have Visual Studio attached to the rundll32,.exe process when Outlook 2010 is installed, I can see via the debugging output that when the user clicks OK, the process loads our primary DLL, and then all the dependencies, and the various dialogs show. If I have Visual Studio attached to the rundll32,.exe process when Outlook 2013 is installed, I can see via the debugging output that it loads our primary DLL into memory, immediately unloads it, and displays a message that says "Outlook will need to be restarted for changes to take effect".  The command line apperently being used is:

"C:\windows\system32\rundll32.exe" C:\Windows\system32\shell32.dll,Control_RunDLL "C:\PROGRA~1\Office15\MLCFG32.CPL",@0

I wrote a program that uses the LoadLibraryEx to load the DLL with various flags set, and found that when no flag or "LOAD_WITH_ALTERED_SEARCH_PATH" is passed, the dll and all dependancies are loaded.  However, passing any combination of LOAD_LIBRARY_SEARCH_* flags caused identical debugging output to that seen from rundll32.exe when Outlook 2013 is installed.  Since all of the LOAD_LIBRARY_SEARCH_* flags disallow searching for DLLs using the $PATH environment variable, it appears that Office 2013's control panel is using one or more of these flags, where no version of Office did before. 

The most likely flag being used is LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, which searches the application directory (rundll32 resides in system32), the system directory (system32), and any folders it has explicitly added via AddDllDirectory (if there's any, I don't know of them).  I tried putting full paths to all of the DLLs in every copy of mapisvc that I could find ("C:\Users\<username>\AppData\Local\Microsoft\Outlook" and "C:\Users\<user>\AppData\Local\Microsoft\Outlook") to no effect.

I've confirmed that by copying all of the DLLs to the system32 directory on my test machine causes everything to load and execute correctly with Office 2013.  Similarly, Outlook was unable to load the dependent DLLs for the primary addin DLL, until I copied those to system32, though I did not repeat the above testing with Visual Studio to confirm the cause.

At this point, the simplest solution seems to simply be to deploy the dlls all into system32, and this very bizarre behavior must be a bug, since I can find no documentation on any such change.  Do I now have to choose between deploying to system32 and converting all of our Dependent DLLs to COM DLLs that can be registered and found that way, or is there some way to add my product's folder to the DLL search path for Outlook and its control panel component?  

Modify Sent Date

$
0
0

Hai…

I want to modify the sent date of a mail item in outlook, Is that possible ?

 

Thanks

Jenus M

creating email notification before due date in excel

$
0
0

How can I create email notification or prompt a reminder on my screen 1 week before the due date if it's not yet approved? Should also notify if not yet approved on the due date or notification on weekly until it is approved? It is possible.

Also need to automatically highlight items not yet approved on the excel itself.

Hope someone can help me or give me a better idea. It will be a big help on my job. 

 

creating msi package for the outlook addin

$
0
0

I made changes in the outlook addin and now i want to create the msi package for the same.

I already have the setup project included in the visual studio solution.

how to create / update msi package, that will reflect my changes?


Brijesh Vaidya India

Outlook Guard Ignoring Trusted Locations Reg Key

$
0
0

Hi,

I seem to be having major problems with the trusted locations reg key for our MS Access applications.

To stop the annoying nag screen when opening the application and also the Outlook Guard from moaning when the application sends emails though Outlook, I set up a Trusted Locations reg key as follows...

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\Location1]
"Date"="01.01.2010 00:00:00"
"Description"="Our Database Name"
"Path"="C:\\Path_To_DB\\"
"AllowSubfolders"=dword:00000001

This has worked fine for several years, however, lately nearly every users is now complaining that the Outlook Guard keeps coming up?

I've had them re-install the reg-keys but it seems to make no difference, why has this started happening and how do I resolve it?

Thanks,

Craig.


To err is human, to really balls things up you need Microsoft!

Viewing all 6421 articles
Browse latest View live