HTMLBody property occasionally returns HTML with no BODY
Hi,
We have an application that can store away .MSG files saved out previously from Outlook. This program allows the user to reply to these emails and, as part of this, gets Outlook to open the message so that it can extract information. It does this using the
CreateItemFromTemplate() method:
item = outlook.CreateItemFromTemplate(file_path)
The problem is that, for some .MSG files, when we access item.HTMLBody property we get back html with no <BODY>, except for a comment:
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 14.02.5004.000">
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
</BODY>
</HTML>
Now this email does contain text which you can see if you look at the original email in Outlook, and I would expect the above code to always return HTML, converted if necessary, but this doesn't appear to be the case.
This might be considered 'normal' behaviour, but it doesn't happen for me if I drag back one of these MSG files from the customer site to my development PC and try it here...So why would Outlook behave differently (and can it be fixed)?
MAPI_E_NOT_ENOUGH_MEMORY in the GetProps tab is perfectly fine. What are the contents of these properties when you actually select them?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!
Yes, I figured that the MAPI_E_NOT_ENOUGH_MEMORY is not an issue itself. The contents of these properties appear to be ok when viewed in Outlook Spy. However, as stated, our software uses Outlook OLE to get the HTMLBody / Body of a MSG file, and that's where
it goes wrong by not returning the text correctly (if at all). I'm just guessing that there is a connection between this Outlook OLE issue and the MAPI_E_NOT_ENOUGH_MEMORY value you see via Outlook Spy.
Similar Messages
-
Bean property that return html format
Hi
I have a bean property that return an HTML as String for example:
"Hello<br><br>x"
i"m using struts-bean like this:
<td><bean:write name="gameBean" property="fullDescription"/></td>
and in page i got:
Hello<br><br>x
and not:
Hello
x
in the html soerce i got
Hello<br><br><x
what can i do?use the filter attribute
<td><bean:write name="gameBean" property="fullDescription" filter = "true"/></td>And this is what the filter attribute does - from the taglib docs
If this attribute is set to true, the rendered property value will be filtered for characters that are sensitive in HTML, and any such characters will be replaced by their entity equivalents.
cheers,
ram. -
Hi there!
I am having some trouble with Data Service that I have created, what it basically does is use templates to generate an HTML page by replacing placeholders and fitting sections together depending on the criteria.
One template looks like this:
<html>
<head>
<meta http-equiv="refresh" content="60" />
<style type="text/css">
</style>
</head>
<body>
<div class="CSSTableGenerator" >
<table>
<tr>
<td>Kiron Interactive<img src="{EventCardImagePath}\Images\Kiron_Logo.png" alt="Mountain View"></td>
</tr>
<tr>
<td>Event Card for {EventCardDateDOW}, {EventCardDateDay}/{EventCardDateMonth}/{EventCardDateYear}</td>
</tr>
<tr>
<td>{EventCardEvents}</td>
</tr>
</table>
</div>
</body>
</html>
What I am having issues with is getting the image to display in the browser, the image is presented as
{EventCardImagePath}\Images\Kiron_Logo.png
in the template, it can be any name or popular format (JPG or PNG)
Currently this is how I am returning the HTML string generated
/// <summary>
/// Method used to Get GSEvents and pass them to the formatter, HTML is then returned using current date
/// </summary>
/// <param name="eventType"></param>
/// <returns>HTML Event Card string</returns>
public System.IO.Stream HTMLEventCardUpcoming(string eventType)
try
//Compile DateTime
DateTime startTime = DateTime.Now;
DateTime endTime = DateTime.Now.Date;
endTime = endTime.AddDays(1).AddTicks(-1);
//Get the events
//Pass events to Adapter
EventCardFormatterAdapter eventform = new EventCardFormatterAdapter();
object htmlEventString;
bool htmlEventStringbool = eventform.TryFormatEventCard(events, startTime, EventCardFormatterAdapter.EventCardFormat.html, out htmlEventString);
string htmlString = htmlEventString.ToString();
byte[] resultBytes = Encoding.UTF8.GetBytes(htmlString);
WebOperationContext.Current.OutgoingResponse.ContentType = "text/html";
return new MemoryStream(resultBytes);
catch (Exception e)
Preferable I would like to be able to specify the local path of the image in the template that's whats currently being done, this is because the template is also used to generate PDFs and that needs the local path but thats working perfectly. Any ideas on
how I can accomplish this?
At the moment images are only working in IE
Thanks in advanceHi
DaveGreen,
Based on your description, your case related to Web HTML. I am afraid that you posted in an inappropriate forum. Please post in the related forum.
Here is the link
http://forums.asp.net
Thanks for your understanding.
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Urgent ! XML Output with header, body, trailer
Gurus,
I am trying to use Report to output an xml file with header, body and trailer regions. However, I find that the tool does not allow me to create a header region with info like <report_date>, <report_name>, <report_desc> etc.
Moreover, the tool is not flexible that in the group level, it always automatically fills in the outer tag for me even if I intentionally leave it blank.
So, except using the XML file output function, is there any other way outputing XML file using the tool? Otherwise, I may need to hard code a program to do so!
Thanks for your advice!
ShoshiHi
Reports XML file is driven by your queries and groups therein. This means that the groups (and break groups) are represented in XML form.
It is not driven by the layout. So your header region does not appear.
What I suggest is that you need to create a report level formula column in the Data Model. The formula returns date, name and description etc. Since this is a part of Data Model now, it will appear in the XML output.
Regards
Sripathy -
Hi,
Can someone please let me know how can I send a email with formatted body. I am planning to use HTML for formatting.
I am using the method
cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = html
i_length = conlengths
i_subject = subject ).
This is not working. However I am able to attach HTML file to the mail .
Thanks and regards,
VamsiHi Mohana,
Please use the below FM first to convert raw text to HTML and then append the html data to final FM.
Please check the below piece of code which we have used and its working.
Header record for converting to HTML
ls_header-tdname = zemailtxt.
ls_header-tdspras = 'E'.
ls_header-tdid = 'ST'.
ls_header-tdobject = 'TEXT'.
ls_header-tdstyle = 'system'.
FM to convert SAP script to HTML
CALL FUNCTION 'CONVERT_ITF_TO_HTML'
EXPORTING
i_header = ls_header
TABLES
t_itf_text = lt_lines
t_html_text = lt_html
EXCEPTIONS
syntax_check = 1
replace = 2
illegal_header = 3
OTHERS = 4.
REFRESH gt_content.
Populate email body to an internal table
LOOP AT lt_html INTO ls_html.
lwa_content = ls_html-tdline.
APPEND lwa_content TO gt_content.
CLEAR lwa_content.
ENDLOOP.
Populate the packing details of Mail body
CLEAR : gv_lines.
DESCRIBE TABLE gt_content LINES gv_lines.
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 0.
lwa_objpack-body_start = 1.
lwa_objpack-body_num = gv_lines.
lwa_objpack-doc_type = 'HTM'.
APPEND lwa_objpack TO lit_objpack.
-- Some code for header and doc size ..
*-- FM for sending email to NERC Team,
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = gs_doc_chng
put_in_outbox = 'X'
sender_address = lv_sender_mail
sender_address_type = lv_add_type
commit_work = gc_x
TABLES
packing_list = lit_objpack
contents_txt = gt_content
receivers = gt_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF. -
Printing HTML with Java Printing Service(JDK1.4 beta)
Hi there!
I'm currently checking out the new Java Printing Service (JPS) in the new JDK1.4 beta. This looks like a very promising printing API, with amongst others printer discovery and support for MIME types - but I have some problems with printing HTML displayed in a JEditorPane.
I'm developing an application that should let the user edit a (HTML)document displayed in a JEditorPane and the print this document to a printer. I have understood that this should be peace-of-cake using the JPS which has pre-defined HTML DocFlavor amongst others, in fact here is what Eric Armstrong says on Javaworld (http://www.javaworld.com/javaone01/j1-01-coolapis.html):
"With JPS, data formats are specified using MIME types, for example: image/jpeg, text/plain, and text/html. Even better, the API includes a formatting engine that understands HTML, and an engine that, given a document that implements the Printable or Pageable interface, generates PostScript. The HTML formatting engine looks particularly valuable given the prevalence of XML data storage. You only need to set up an XSLT (eXtensible Stylesheet Language Transformation) stylesheet, use it to convert the XML data to HTML, and send the result to the printer."
After one week of reasearch I have not been able to do what Armstrong describes; print a String that contains text of MIME type text/html.
I have checked the supported MIMI types of the Print Service returned by PrintServiceLookup.lookupDefaultPrintService(). This is the result:
DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(MediaSizeName.ISO_A4);
aset.add(new Copies(2));
PrintService[] service = PrintServiceLookup.lookupPrintServices(flavor,aset);
if (service.length > 0) {
System.out.println("Selected printer " + service[0].getName());
DocFlavor[] flavors = service[0].getSupportedDocFlavors();
for (int i = 0;i<flavors.length;i++) {
System.out.println("Flavor "+i+": "+flavors.toString());
Selected printer \\MUNIN-SERVER\HP LaserJet 2100 Series PCL 6
Flavor 0: image/gif; class="[B"
Flavor 1: image/gif; class="java.io.InputStream"
Flavor 2: image/gif; class="java.net.URL"
Flavor 3: image/jpeg; class="[B"
Flavor 4: image/jpeg; class="java.io.InputStream"
Flavor 5: image/jpeg; class="java.net.URL"
Flavor 6: image/png; class="[B"
Flavor 7: image/png; class="java.io.InputStream"
Flavor 8: image/png; class="java.net.URL"
Flavor 9: application/x-java-jvm-local-objectref; class="java.awt.print.Pageable"
Flavor 10: application/x-java-jvm-local-objectref; class="java.awt.print.Printable"
As you can see there is no support for text/html here.
If anyone has a clue to what I'm missing here or any other (elegant, simple) way to print the contents of a JEditorPane, please speak up!
Reply to: [email protected] or [email protected] or here in this forumSince you have 'printable' as one of your flavors, try this using a JTextPane (assuming you can dump your HTML into a JTextPane, which shouldn't be a big problem)...
1. Have your JTextPane implement Printable
ie. something like this:
public class FormattedDocument extends JTextPane implements Printable 2. Read your HTML into the associated doc in the text pane.
3. Implement the printable interface, since you have it as one of your available flavors (I'd imagine everybody has printable in their available flavors). Something like this:
public int print(Graphics g, PageFormat pf, int pageIndex) {
Graphics2D g2 = (Graphics2D) g;
g2.translate((int)pf.getImageableX(), (int)pf.getImageableY());
g2.setClip(0, 0, (int)pf.getImageableWidth(), (int)pf.getImageableHeight());
if (pageIndex == 0)
setupPrintView(pf);
if (!pv.paintPage(g2, pageIndex))
return NO_SUCH_PAGE;
return PAGE_EXISTS;
}Here's my setupPrintView function, which is executed once on page 0 (which still needs some polishing in case I want to start from page 5). It sets up a 'print view' class based on the root view of the document. PrintView class follows...
public void setupPrintView(PageFormat pf) {
View root = this.getUI().getRootView(this);
pv = new PrintView(this.getStyledDocument().getDefaultRootElement(), root,
(int)pf.getImageableWidth(), (int)pf.getImageableHeight());Note of obvious: 'pv' is of type PrintView.
Here's my PrintView class that paints your text pane line by line, a page at a time, until there is no more.
class PrintView extends BoxView
public PrintView(Element elem, View root, int w, int h) {
super(elem, Y_AXIS);
setParent(root);
setSize(w, h);
layout(w, h);
public boolean paintPage(Graphics2D g2, int pageIndex) {
int viewIndex = getTopOfViewIndex(pageIndex);
if (viewIndex == -1) return false;
int maxY = getHeight();
Rectangle rc = new Rectangle();
int fillCounter = 0;
int Ytotal = 0;
for (int k = viewIndex; k < getViewCount(); k++) {
rc.x = 0;
rc.y = Ytotal;
rc.width = getSpan(X_AXIS, k);
rc.height = getSpan(Y_AXIS, k);
if (Ytotal + getSpan(Y_AXIS, k) > maxY) break;
paintChild(g2, rc, k);
Ytotal += getSpan(Y_AXIS, k);
return true;
// find top of page for a given page number
private int getTopOfViewIndex(int pageNumber) {
int pageHeight = getHeight() * pageNumber;
for (int k = 0; k < getViewCount(); k++)
if (getOffset(Y_AXIS, k) >= pageHeight) return k;
return -1;
}That's my 2 cents. Any questions? -
Tags with empty body can't work in WLS 7.0SP5
Hi, I'm now using WLS 7.0 SP5. In my JSPs, I have the following tag with empty body:
<jsp:setProperty name="xxxForm" property="style123" value="abc"/>
It doesn't work. The script works if I change that into:
<jsp:setProperty name="xxxForm" property="style123" value="abc"></jsp:setProperty>
However I have found that this problem should be fixed in WLS 7.0 SP1 already. (http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_solution&answerpage=solution&page=wls/S-13458.htm) Any hint about this strange problem? Thanks in advance!HI,
I am using RangeTimeStep for displaying data in time range. I dont know understand whats wrong with this code as it displays graph with some other criteria that I donot specify in RangeTimeStep. The member of Day is like 02/16/2003 and member value is DAY_460. Although I passed both the values but still getting the same graph.
Would you please tell me whats wrong in the code?
Presentation graph1 = (Presentation)pageContext.findAttribute("ahb_country_pres1");
ThinGraph bubbleGraph = (ThinGraph)graph1.getView();
QueryClient query = (QueryClient) bubbleGraph.getDataSource();
String strTimeDim = "MDM!D_RMI_RIM_OWNER.TIME";
String strStandardHier = "MDM!D_RMI_RIM_OWNER.TIME.TIME_HIER";
Vector vec = new Vector();
vec.addElement("MDM!D_RMI_RIM_OWNER.TIME.TIME_HIER.L.DAY");
Selection sel1 = query.findSelection(strTimeDim);
RangeTimeStep rangeTimestep1 = new RangeTimeStep(strTimeDim,strStandardHier, vec, new Integer (2), RangeTimeStep.BEFORE,"DAY_460");
rangeTimestep1.setAction(RangeTimeStep.KEEP);
sel1.removeAllSteps();
sel1.addStep (rangeTimestep1);
query.applySelections(new Selection[]{sel1});
query.refreshAll();
Regards,
Aamir -
Hi every body !
Can someone please tell me how I can manage HTML with a AWT component ?
With Swing, we for example use JEditorPane or JTextPane as I did for a JApplet (http://www.big-chat.com).
As it is for Applet, I want it to be avalaible in all browsers. But now, it is not the case !
Please help.
Thanks !Why won't JApplet work in all browsers? Every browser that I know (that is graphical) supports the Java plug-in.
If you want to support the MS JVM in IE users without the plugin, well there are some things you should know:
1) MS is not shipping this anymore for newer systems (Win 2003 and XP SP1a).
2) It's Java version 1.1.4, so there's a whole heck of a lot of stuff that won't work.
3) It's going to be officially retired in 2007 (was supposed to be in Sept 2004, actually).
I highly doubt that there's an AWT-based HTML display component out there. There's not one written in Swing that is a complete, up-to-date browser as it is.
Just stick with the plugin. -
Auto display HTML attachments in body / email sent from mac mail
Hi,
One of my clients has received an email written in MAC Mail, the email doesn't display correctly instead what would be the body of the email appears as an html attachment, he doesn't want to have to click the attachment to preview it as he doesn't have to
do this on the iphone (also an apple device hmm....), I cant see any way of making it auto display the html in the body without clicking it.
Does anyone have any ideas?Hi,
Can you confirm if the sender has this problem sending emails to other recipients?
Please logon your Webmail(or OWA), does that message display as an attachment as well?
If other Outlook recipients also see the email body as an attachment and you can verify it shows as an attachment on Web as well, I'm afraid we should blame the Apple Mail Client, since I've seen some Apple Mail users have this problem:
https://discussions.apple.com/thread/1947994?tstart=0
Kindly have the sender check if the setting like Edit > Attachments > Send Windows friendly Attachments
has been checked.
If I'm not getting this wrong, we should confirm this issue with Apple:
https://discussions.apple.com/index.jspa
Feel free to post back of course.
Regards,
Melon Chen
TechNet Community Support -
Is the customer allowed to return the (with applecare plus warranty) ipad wifi to exchange it to ipad wifi- 4g?
You'll have to sell the iPad and use the proceeds to buy a new iPad.
How to Sell Your Old iPad http://tinyurl.com/85d69lk
Other sources to sell.
eBay Instant Sell http://instantsale.ebay.com/?search=ipad
Sell and Recycle Used Electronics - Gazelle http://www.gazelle.com/
Sell Electronics for Cash - Next Worth http://www.nextworth.com/
Buy My Tronics http://www.buymytronics.com/
Sell Your iPad http://www.sellyourmac.com/mac-product-guides/ipad.html
Totem http://www.hellototem.com/
Cheers, Tom -
A problem with return order with free goods
Hello
I am working on ECC 6.0
I am facing a problem with the return order the case is I created an order of 1000 pc with inclusive free goods (w/o item generation) condition record that for every 10 pc over the 100 the customer will take 1 free pc
1 pc = 10 $
100 pcs = 900 $
120 = 1080 $
the problem when I am creating a return order with 30 pcs the system calculate the price as if there are free goods the system returns the 30 pcs with 270 $ instead of 180 $ and it should not calculate the free goods because the remaining items are 90 pcs that should not take a free goods discount
Regards
Jacopo Francioshi ,
Such scenerios can be tackled by different pricing procedure in return scenerio.
See Pricing procedure Depends on sales area + customer pricing procedure + Document pricing procedure .
So for Return document type please maintain different pricing than the normal scenerio this will solve ur problem.
This is generally done also for tackling such scenerios.
Thanks & Regards -
Return process with credit note.
Hi Experts,
I have done a sales order with quantity 9 pcs, delivered and PGI with quantity 9 pcs and also invoiced the customer for 9 Pcs. Now customer has returned 4 pcs, in this case he has to only pay for 5 pcs.
I have done return process
1. Create returns order with T.Code VA01 and order type RE and quantity of 4 Pcs
2. Delivery with VL01N and Post Goods Reciepts of 4 Pcs
3. Transfer 4 pcs from return to unrestricted use.
now how to raise credit memo ......please guide me step by step.
Regards
RahulI suggested you G2 Invoice type by mistake. Apologies.
You need to use Credit for Returns Invoice Type - RE.
Go to T-Code VF01 & select Invoice Type as RE. Now create this Credit for Returns Invoice with Reference to your Returns order Type.
If the above is not happening then check T-Code VTFA & maintain copy controls for RE (Order) to RE (Invoice)
Hope this helps,
Thanks,
Jignesh Mehta -
Net value issue while creating return order with reference to billing
Dear All,
I created SO / DEL/ BILLING for qty 100 say net value-20000.When i created Return order with refrence to billing document,
net value appearing same ( 20000) for 50 quantity.Pl do advise asap as its required urgently.
Thanks in advance.
Regards
raj
Edited by: raj_sapsd on Aug 20, 2010 9:18 AMsurelly problem in VTAF
F2 to RE
DATAT: 103
DATAT: 103
DATAT: 003
Coping requirement 021
item level TAN and ietm cat proposal G2N
DataT: 153
Datat: 104
datat: 004
Coping requirement 303
Update doc Flow X
only possibilites Removed my Moderator
Edited by: Lakshmipathi on Aug 21, 2010 9:31 AM
Please avoid asking for points -
Return Order with reference to Proforma invoice
Dear All
Is it possible to create a return order with reference to proforma invoice. How ?? if possible.
Our scenario is when we do stock transfer order and truck meets with an accident or anything and material needs to written to the factory premises. we dont want to complete proforma invoice.
Suggestions PLZZ
Regards-
RamI don't see any the relevance or logic of creating of return order from proforma invoice.
You can follow - Returns flow:
PO type is same ( Intercompany STO PO type is NB )
While you make this PO there is a return indicator check box at the line item where you will give qty etc (scroll on the rt side)
Tick that
Then save the PO with all other information
There is a configuration Return delivery type has to be assigned
IMG-MM-Purchasing-PO-Returns Order-Return Plant to Plant
Here for your plant you need to assign delivery type as NCR This config is reqd to be done from your end
So, the Flow would be
- ME21N (with returns indicator)
-VL10B
-VL02N (delivery type will be NCR ) & do a PGR here
-VF01 do billing with reference to delivery created
I Category in del will be NCRN & M type will be 673
If you are using standard document types system will pick billing type as IG which is nothing but a intercompany credit memo
Copy controls between NCR and IG in VTFL is already there in standard
For understanding also, refer following link:
return process intercompany stock transfer
Hope this can assist you.
Thanks & Regards
JP -
Return order with reference to the billing document created via IDOC.
Dear Colleagues,
I’m struggling to understand and confirm whether standard functionality of ORDERS05 idoc allows creating a return order with reference to existing billing document?
I have tried using standard segment E1EDK02 and E1EDP02 with qualifiers 009,010,011,087 but unfortunately idol is not creating a return order with reference and ignoring this segment.
Have any one came across similar problem? If yes then will be grateful for sharing his experience.
Best regards,
ALDear Friend
Welcome to SDN
Return order is itself a challenge to SAP standard settings
There are some scenarios
1. Return order qty should not be increasesd say Billed qty of material X is 20 units
While returning Material X should be a maximum of 20 units
If made 21 it should throw error T code OVAH message class V4 message no 299 convert from warning to error thro customization
2.Return order should be created only once referencing billing doc
To control that T code SE91 message class V1 message no 499 convert from warning to error thro ABAP help
3 Your issue is same like case 1 but the material X is entered as second line item in the return order with some qty
This case system is not throwing even a warning
Yes correct
This is to be handled with userexit
Discuss the same with ABAPer
Check these threads on return issues which is of different scenario than of yours
Forum post in ERP - Sales and Distribution (SD) General: Order Qty.
Order Qty.
Forum post in ERP - Sales and Distribution (SD) General: Return order
Return order
Regards
Raja
Maybe you are looking for
-
How to restore or backup Apex application from Command line ? URGENT
We have Oracle apex 4.1 installed in Oracle 11g R2 database (windows 64-bit) 2008 R2 For some reason our database dictionary objects are corrupted. We wanted to backup our Apex applications in some workspaces ASAP. We are not able to access apex from
-
In Search of Inspiration.
Hi there. I have been using Premiere Pro for 6-7 years now, editing other people footage. I would like to be able to create a showreel using footage that I have shot myself and then edited together with Premiere Pro and After Effects. My problem is t
-
How do I get my home page back and uninstall "home.mywebsearch"?
When I open up Mozilla Firefox the home page has been changed from "comcast.net" to "http://home.mywebsearch.com/index... Is this from Firefox? What happened to my homepage? What is this page, and how do I go back to the home page comcast.net? Who is
-
MBP 15 is running and screen goes white with thin vert lines
Running normally and if I adjust the screen angle it goes white with lines. Just started happening. 10.5.8 about 4 years old
-
hello guys, i've created a frame using these codes JFrame frame = new JFrame(); frame.setSize(FRAME_WIDTH, FRAME_HEIGHT); frame.setTitle("Aeroplane Seat"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);