Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine howto of mapirtf installation #18

Open
koppor opened this issue Oct 17, 2021 · 7 comments
Open

Refine howto of mapirtf installation #18

koppor opened this issue Oct 17, 2021 · 7 comments

Comments

@koppor
Copy link
Contributor

koppor commented Oct 17, 2021

Following Boolean enables QuoteColorizer:

Private Const DEFAULT_USE_COLORIZER As Boolean = False

That, in turn, requires mapirtf.dll.

This file is from 1997-08-28 and can be retrieved from http://download.microsoft.com/download/mapi/utility/11/w9xnt4/en-us/mapirtf.exe. (Linked from KB 172038).

That .exe can be extracted with 7zip.

About 2008, it worked to copy mapirtf.dll to C:\Windows\System32.

Now, I get the following error:

grafik

That translates to "Runtime error 53" "File not found: mapirtf.dll".

Via https://stackoverflow.com/q/53316591/873282 - "Call C++ DLL from VBA". Very similar issue (Run-time error '53'). I came to following solution:

  1. Place mapirtf.dll to c:\temp\mapirtf.dll
  2. Use full path in Public Declare PtrSafe Function ReadRTF _ --> Lib "c:\temp\mapirtf.dll" _

Unfortunately, Outlook 2019 completely crashes when executing ReadRTF -->

ret = ReadRTF(session.CurrentProfileName, MyMailItem.EntryID, folder.StoreID, rtf)

@koppor koppor mentioned this issue Oct 17, 2021
@Mo-Gul
Copy link
Contributor

Mo-Gul commented Oct 17, 2021

I did something similar. I just used the path of the system32 folder, but it didn't result in a crash. So what are our differences. I am on Win10 64-bit and Outlook 2019 64-bit. What is on you side?

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Oct 17, 2021

I checked again and I can confirm to get runtime error 48.

grafik

But googling for the error states "Error in loading DLL (Error 48) (maybe a false/missed translation) which is of course another error than yours.

@koppor
Copy link
Contributor Author

koppor commented Oct 17, 2021

I have Microsoft® Outlook® 2019 MSO (Version 2109 Build 16.0.14430.20154) 32 Bit running on Microsoft Windows [Version 10.0.19042.1288] (64bit)

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Oct 17, 2021

Ok, I guessed/hoped that you are on 32-bit Outlook. I know it from an Excel AddIn that when the signatures of the functions don't match that 32-bit versions crash and 64-bit versions not. So I strongly believe that this is the same problem here.

Since all parameters are strings and the return value the function is an integer I don't think we can solve this. Do you have any hopes/ideas?

@koppor
Copy link
Contributor Author

koppor commented Oct 19, 2021

Regarding the crash, I got following hint:

Have you tried inspecting the DLL in Visual Studio to see what it exports? I don't have Outlook 2019, only 365. You could then try writing something to call the DLL in Visual Studio to see if you can trap the error.

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Oct 20, 2021

That are good news. I didn't know that this is possible. But now knowing I found Which program in Visual Studio lets me look into DLLs to see its API? on StackOverflow. There are also listed other tools than Visual Studio that should be able to show the signatures, especially in user4898056's answer.

Please let me know which tool worked for you.

@koppor
Copy link
Contributor Author

koppor commented Oct 20, 2021

Thank you for the links! I hope, I can investigate on beginning of November!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants