Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2022, 06:15 AM
RFarrar RFarrar is offline Outlook VBA - .RTFBody Formatting Issues from Byte Array Windows 10 Outlook VBA - .RTFBody Formatting Issues from Byte Array Office 2021
Novice
Outlook VBA - .RTFBody Formatting Issues from Byte Array
 
Join Date: Sep 2022
Posts: 1
RFarrar is on a distinguished road
Lightbulb Outlook VBA - .RTFBody Formatting Issues from Byte Array

Hello everyone!


First post and it's a problem!


I am developing a VBA / VSTO script that interacts with Outlook.


I have a process that should, essentially, do this:


  1. Read in an .oft file that is in Rich Text Format
  2. Parse the RTFBody array into a String
  3. Replace some elements of the String (so a line that says "%SUBJECT%" will instead be "IMPORTANT MEETING")
  4. Convert that String back into the RTF array format (this uses a Rich Text Box)
  5. Replace the RTFBody with the updated RTF array
  6. Display the finished email
This is all done. Except the finished email is just RTF garbage with no formatting.

So what is meant to be a lovely table is instead this:
PHP Code:
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff37\deff0\stshfdbch0\stshfloch37\stshfhich37\stshfbi37\deflang2057\deflangfe2057\themelang2057\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304 
(You can imagine the rest.)


Does anyone have any awareness of what the solution to this problem is?


And before anyone suggests HTML... I would love to! But this is an AppointmentItem so it doesn't support HTMLBody.
Reply With Quote
Reply

Tags
rich text format, rtfbody, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting issues (numbering and other issues) in big document. Possibly corrupted. Can anyone help? Ida Word 9 07-26-2018 10:22 AM
Formatting issues OLq Project 0 05-16-2017 12:22 PM
Outlook VBA - .RTFBody Formatting Issues from Byte Array .RTFBody property for a mail item is returning error mlewis Word VBA 6 11-02-2016 06:51 AM
Outlook VBA - .RTFBody Formatting Issues from Byte Array Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM
outlook programmatically read an attachment into byte array chriskaza81 Outlook 0 11-19-2010 01:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:20 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft