Outlook Body limited to 132 char

Reinhard
Member Posts: 249
Hi!
I was asked to have N. automatically generate an email. Usually I use the smtpMailX OCX for this. But she asked me to open it in Outlook so she can double-check the message as well as add in some additional comments if needed.
var objApp 'Microsoft Outlook 11.0 Object Library'.Application
var objMail 'Microsoft Outlook 11.0 Object Library'.MailItem
The problem arises from the fact that if I try to write a long message in the body method it will stop my from typing at some opint. (After 132 char.) If I copy paste past that limit it pops up an error:
"The last ediditng action (often 'paste') was ignored because it would have cause dthe maximum number of characers (132) for the text box Control1 to be exceeded."
I figured this would be a common problem since I saw no "addBodyLine" type of method. A mibuso search didn't bring up anything. So I'm asking for help, thanks in advance! I found many code snippets using this automation on msdn.com but every time the body was only a short sentence.
What is causing the problem? How can I get around it?
I was asked to have N. automatically generate an email. Usually I use the smtpMailX OCX for this. But she asked me to open it in Outlook so she can double-check the message as well as add in some additional comments if needed.
var objApp 'Microsoft Outlook 11.0 Object Library'.Application
var objMail 'Microsoft Outlook 11.0 Object Library'.MailItem
//Create application IF ISCLEAR(objApp) THEN CREATE(objApp); //Create mail item objMail := objApp.CreateItem(0); //Set properties objMail."To"('reinhard.ruescher@oztera.com'); objMail.Subject('Mail from Navision'); objMail.Body('This method wont take parameters over 132 char!'); //Uncomment for display email //objMail.Display(); //Send mail objMail.Send();
The problem arises from the fact that if I try to write a long message in the body method it will stop my from typing at some opint. (After 132 char.) If I copy paste past that limit it pops up an error:
"The last ediditng action (often 'paste') was ignored because it would have cause dthe maximum number of characers (132) for the text box Control1 to be exceeded."
I figured this would be a common problem since I saw no "addBodyLine" type of method. A mibuso search didn't bring up anything. So I'm asking for help, thanks in advance! I found many code snippets using this automation on msdn.com but every time the body was only a short sentence.
What is causing the problem? How can I get around it?
0
Answers
-
Does this work :?:
objMail.Body('the First 132 chars');
objMail.Body('the next 132 chars');Do you make it right, it works too!0 -
It seems I have miscategorized the problem. Here is something that works:
strOne := "132 char"; strTwo := "132 char"; objMail.Body(strOne + strTwo); //this works and exceeds the "limit"
curiously, I can't assign strOne more than 132 char either. In other words NOTHING seems to be able to do that. Interesting. So I guess I solved my problem but I still feel like I don't understand what's going on.0 -
I know what the problem that I have been having is. Don't laugh, because it's embarrassing.
The 132 char limit I have been dealing with is the width of the code editor!
arghh.... maybe instead of a cryptic error message it should just go ahead and place the cursor at the start of the next line? I just started working here and our screens are fairly large... so I am not used to this kind of problem of course... and even notepad does not have this kind of limitation so I was not considering it at all.0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions