| | |
VB.NET/Outlook Message Display Issue
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 6
Reputation:
Solved Threads: 0
Hello everyone, I'm new here and have a question for you! I was working on a very complex macro in VBA using Outlook 2007's macro editor, but then realized the project is more suited for a standalone executable. Feeling working on this in VB6 was too outdated, I switched over to VB.NET (on VS Express 2008), and began porting my code.
Everything seems to be working fine as 90% of the code is simple logic, not playing around with Outlook. The one problem I am having is involving code that reads HTML from a file & places it in the HTMLBody of a new Outlook message.
When using VBA code with what appears to be the exact same functionality (see below), I get different results. When I scan the HTML file's text & put it in the messages HTML body using VBA everything ends up fine (images intact, no weird formatting errors).
When I scan the same HTML file using VB.NET code & fill in the HTML body, I get strange formatting errors and a red X on each of the images telling me the following error:
"The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, then open the file again. If the red x still appears, you may have to delete the image and then insert it again."
Yet when I test the same thing again in VBA (after receiving this error), everything once again still works fine.
The HTML template I am using was exported from an OST file in Outlook, so there is some strange formatting that's not in regular HTML files. I don't know why or how this would affect the display of information though, if everything is working fine with one method.
If anyone has ANY suggestions or thoughts, please let me know! It would be greatly appreciated.
-corteplaneta
Everything seems to be working fine as 90% of the code is simple logic, not playing around with Outlook. The one problem I am having is involving code that reads HTML from a file & places it in the HTMLBody of a new Outlook message.
When using VBA code with what appears to be the exact same functionality (see below), I get different results. When I scan the HTML file's text & put it in the messages HTML body using VBA everything ends up fine (images intact, no weird formatting errors).
When I scan the same HTML file using VB.NET code & fill in the HTML body, I get strange formatting errors and a red X on each of the images telling me the following error:
"The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, then open the file again. If the red x still appears, you may have to delete the image and then insert it again."
Yet when I test the same thing again in VBA (after receiving this error), everything once again still works fine.
The HTML template I am using was exported from an OST file in Outlook, so there is some strange formatting that's not in regular HTML files. I don't know why or how this would affect the display of information though, if everything is working fine with one method.
If anyone has ANY suggestions or thoughts, please let me know! It would be greatly appreciated.
-corteplaneta
•
•
Join Date: Oct 2008
Posts: 6
Reputation:
Solved Threads: 0
Well can someone at least tell me a different way of reading file contents than this:
VB.NET Syntax (Toggle Plain Text)
Public Function GetFileContents(ByVal FullPath As String, _ Optional ByRef ErrInfo As String = "") As String Dim strContents As String Dim objReader As StreamReader Try objReader = New StreamReader(FullPath) strContents = objReader.ReadToEnd() objReader.Close() Return strContents Catch Ex As Exception ErrInfo = Ex.Message End Try End Function
Last edited by corteplaneta; Oct 9th, 2008 at 10:06 am.
![]() |
Similar Threads
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- Computer keeps restarting! (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: Excel sheet format (column) sequence is changing
- Next Thread: Smart phone emulator
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary box button buttons center click code combo combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall login math memory mobile module ms msaccess mssqlbackend mysql navigate net opacity pan peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog search serial sorting sqldatbase storedprocedure string temp textbox timer txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





