Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to OpenAI Part 2    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Paragraphs Error
Eduardo Benaim 
     
2 years ago
I tried to copy/paste a letter  from word  into the api. Because of the paragraphs it gives back an error. Taking out the carriage returns fixes the AI but it takes the formatting out.
In ChatGPT the formatting is respected

Do you have a fix for this in the API?

I plan to have al outgoing letters reviewed but i would like to fix the formatting loss
Sami Shamma  @Reply  
             
2 years ago
Hi Edwardo
I have the same problem; perhaps Richard have a solution for us.
Eduardo Benaim OP  @Reply  
     
2 years ago
Chat GPT Said:

It sounds like you're encountering an issue with preserving formatting when using the API for processing text. Preserving formatting can be a bit trickier in API environments compared to interactive environments like ChatGPT. Here are a few suggestions to help address this:

Preprocess the text: Before sending the text to the API, you can preprocess it to remove any characters or formatting that might cause errors. This could involve removing carriage returns, extra spaces, or any other non-essential formatting that might interfere with the API's processing.

Use a specialized API endpoint: Some APIs offer specialized endpoints or options for handling formatted text. Check the documentation for the API you're using to see if there are any specific endpoints or parameters you can use to preserve formatting.

Encode the text: Another approach is to encode the text in a format that preserves formatting, such as HTML or Markdown. You can then send the encoded text to the API, and decode it on the other end to restore the formatting.

Handle errors gracefully: If the API returns an error due to formatting issues, you can handle it gracefully in your application by providing feedback to the user and allowing them to correct the formatting before resubmitting the text.

Provide a preview feature: If possible, consider implementing a preview feature that allows users to see how their text will look after processing before submitting it to the API. This can help catch any formatting issues before they become a problem.

By implementing one or more of these approaches, you should be able to minimize the loss of formatting when using the API for processing text.
Eduardo Benaim OP  @Reply  
     
2 years ago
I welcome Richards AUTOMATED solution.   If he is checking Letters to Customers, maybe he has seen this problem.
Eduardo Benaim OP  @Reply  
     
2 years ago
This Works:

</p> Hello</p>
</p>
</p> wht is your nam</p>
</p> Eduardo</p>

The Bot is now: Correct the following text for spelling, grammar, and punctuation ONLY. Do not reword it. It's OK to break large blocks of text up into smaller paragraphs for readability. Remove html.

Again. Need Automation. Pls
Richard Rost  @Reply  
          
2 years ago
I believe I talk about this in one of the lessons you have to escape the characters in other words if you're converting to something that you're sending to the AI then you have to replace vbNewLine with \n. And then when you get a response back from the AI just reverse that process.
Eduardo Benaim OP  @Reply  
     
2 years ago
yes. I substituted the /n returned and it works fine. thank you.

New Suggestion:
Add a [Translate to] combo box for the script to be translated before sending it to the API.
Works like a charm.

This will translate and check your grammar as well.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in OpenAI Part 2.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 3:38:46 AM. PLT: 1s