We are seeing a change to the HTML body of a mail item when unwrapping the RDOMail from the unwrapped RDOStore.
We have tried with the latest Redemption code (5.23)
The code we are using follows:
RDOStores rdoStores;
RDOStore rdoStore, unwrappedRdoStore;
RDOFolder rdoFolder;
RDOMail unwrappedRdoMail;
using (_comObjectHelper.GetMonitor(rdoFolder = mail.Parent))
using (_comObjectHelper.GetMonitor(rdoStore = rdoFolder.Store))
using (_comObjectHelper.GetMonitor(rdoStores = rdoSession.Stores))
using (_comObjectHelper.GetMonitor(unwrappedRdoStore = rdoStores.UnwrapStore(rdoStore)))
using (_comObjectHelper.GetMonitor(unwrappedRdoMail = unwrappedRdoStore.GetMessageFromID(mail.EntryID)))
{
rdoMailAction?.Invoke(unwrappedRdoMail);
unwrappedRdoMail.Save();
}
IRDOMail item HTMLBody from rdoSession.GetRDOObjectFromOutlookObject(_MailItem) (correct):
<html>
<head>
<meta name=\"Generator\" content=\"Microsoft Word 15 (filtered medium)\" />
<style>
<!--\r\n/* Font Definitions */\r\n#font-face\r\n\t{font-family:\"Cambria Math\";\r\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\r\n#font-face\r\n\t{font-family:Calibri;\r\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;}\r\n/* Style Definitions */\r\np.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin:0in;\r\n\tmargin-bottom:.0001pt;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Calibri\",sans-serif;}\r\nspan.EmailStyle17\r\n\t{mso-style-type:personal-compose;\r\n\tfont-family:\"Calibri\",sans-serif;\r\n\tcolor:windowtext;}\r\n.MsoChpDefault\r\n\t{mso-style-type:export-only;\r\n\tfont-family:\"Calibri\",sans-serif;}\r\n#page WordSection1\r\n\t{size:8.5in 11.0in;\r\n\tmargin:1.0in 1.0in 1.0in 1.0in;}\r\ndiv.WordSection1\r\n\t{page:WordSection1;}\r\n-->
</style>
</head>
<body lang=\"EN-US\" link=\"#0563C1\" vlink=\"#954F72\">
<div class=\"WordSection1\">
<p class=\"MsoNormal\">test </p>
<p class=\"MsoNormal\"> </p>
<p class=\"MsoNormal\">test </p>
<p class=\"MsoNormal\"> </p>
<p class=\"MsoNormal\">test</p>
<p class=\"MsoNormal\"> </p>
<p class=\"MsoNormal\">test test</p>
</div>
<span/>
</body>
</html>\r\n
RDOMail unwrappedRdoMail item HTMLBody (incorrect - extra 'B' characters on blank paragraphs):
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">
<meta name=\"Generator\" content=\"Microsoft Word 15 (filtered medium)\">
<style>
<!--\r\n/* Font Definitions */\r\n#font-face\r\n\t{font-family:\"Cambria Math\";\r\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\r\n#font-face\r\n\t{font-family:Calibri;\r\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;}\r\n/* Style Definitions */\r\np.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin:0in;\r\n\tmargin-bottom:.0001pt;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Calibri\",sans-serif;}\r\nspan.EmailStyle17\r\n\t{mso-style-type:personal-compose;\r\n\tfont-family:\"Calibri\",sans-serif;\r\n\tcolor:windowtext;}\r\n.MsoChpDefault\r\n\t{mso-style-type:export-only;\r\n\tfont-family:\"Calibri\",sans-serif;}\r\n#page WordSection1\r\n\t{size:8.5in 11.0in;\r\n\tmargin:1.0in 1.0in 1.0in 1.0in;}\r\ndiv.WordSection1\r\n\t{page:WordSection1;}\r\n-->
</style>
</head>
<body lang=\"EN-US\" link=\"#0563C1\" vlink=\"#954F72\">
<div class=\"WordSection1\">
<p class=\"MsoNormal\">test </p>
<p class=\"MsoNormal\">B </p>
<p class=\"MsoNormal\">test </p>
<p class=\"MsoNormal\">B </p>
<p class=\"MsoNormal\">test</p>
<p class=\"MsoNormal\"> </p>
<p class=\"MsoNormal\">test test</p>
</div>
<span/>
</body>
</html>\r\n
Has anyone seen this behaviour? Any ideas on how to solve this problem?
Turned out there was some funny characters  and a0 in the received email, which points to incompatibilities between the 2 different mail servers (GSuite and IMAP).
Nothing could be done in this case.
Related
For the life of me I cannot get control of anything in this modal. I just want to click on this dang save button.
For all the other modals that are like this I am able to use this code successfully:
#driver.switch_to.frame #driver.find_element(:xpath, "//*[contains(#name, 'modal')]")
I get a not found error this time around though.
Here's the html of the modal i'm trying to access -NOTE the modal number changes so I can't hard code modal3:
and here's the html for the button:
<html class=" ext-strict">
<head>
<body class=" ext-gecko ext-gecko2" keydownhandlerset="true">
<div id="patientChartsContainer">
<div id="patientSearch" style="display:none">
<div class="tooltipWrapper">
<div id="patientPhotoContainer"></div>
<div id="modalWindowContainer" class="">
<div class="axShadowLayer window local" style="display: block; width: 558px; height: 453px; left: 384px; right: auto; top: 228px; z-index: 1010;">
<div class="axShadowTopRow">
<div class="axShadowMiddleRow">
<div class="axShadowBottomRow">
<div class="axShadowContentLayer">
<div class="priModalWrapper">
<ul class="priModalHeader">
<div class="priModalContentBackground"></div>
<ul class="priModalFooter">
<div class="priModalContentWrapper">
<div class="priModalContentContainer">
<iframe id="modal1" class="windowFrame" name="modal1" src="/chart/ui/desktop/patientCharts/chartSummary/chartNote/createChartNote/createNoteModal.html" allowtransparency="true" frameborder="0">
<!DOCTYPE html>
<html class=" ext-strict" xmlns="http://www.w3.org/1999/xhtml">
<head>
<body class=" ext-gecko ext-gecko2" keydownhandlerset="true">
<div id="newNoteContainer" class="newEncounterNote">
<ul class="newNoteOptions">
<div class="axModalButtonsFooter">
<div class="footerButtonsWrapperRight">
<div class="buttonClass axSaveButton">
<span>Save</span>
I've tried a few things and variations of what I have below:
##driver.find_element(:xpath, "//div[#id='modalWindowContainer']/div/div[4]/div/ul/li/div[2]/div[3]").click
##driver.switch_to.frame #driver.find_element(:xpath, "//*[contains(#name, 'modal')]")
##driver.switch_to.default_content
##driver.switch_to.frame(#driver.find_element(:class, 'windowFrame'))
##driver.find_element(:css, "div.buttonClass.axSaveButton").click
##driver.switch_to.frame #driver.find_element(:class, 'windowFrame')
##driver.find_element(:xpath => "//button/span[contains(text(),'Save')]").click
/html/body/div1/div/div/div/span
Try:
##driver.switch_to.default_content
##driver.switch_to.frame #driver.find_element(:class, 'windowFrame')
##driver.find_element(:css, "div.buttonClass.axSaveButton > span").click
This will:
reset the frame context
find the proper iframe
Click on the span (which has the save text, and might hold the listener) element in the <div class="buttonClass axSaveButton"> tag
Problem: when I append Meta tag, I see:
<div class="news_video div_video20151128141055" id="video-schema" item-prop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<div id="video-schema-meta">
<div> </div>
</div>
</div>
<meta content="Video" itemprop="description" />
But it must be:
<div class="news_video div_video20151128141055" id="video-schema" item-prop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<div id="video-schema-meta">
<div><meta content="Video" itemprop="description" /> </div>
</div>
</div>
However, if I change META to DIV, all works correctly.
Similar problem was earlier, but it was fixed (https://dev.ckeditor.com/ticket/8117)
And now I don't know what should I do. Maybe I doing something wrong?
We need to convert/provide our html-based in-app HelpSystem to an on-disc pdf for the client to view outside of the application.
I'm trying to use wkhtmltopdf with a very basic file (3 frames with links to simple .html files) but getting an empty .pdf when I run the following from the command line:
wkhtmltopdf "C:\Program Files (x86)\wkhtmltopdf\index.html" "c:\delme\test.pdf"
I know frames are somewhat deprecated but it’s what I’ve got to deal with. Are the frames causing the empty pdf?
Index.html:
<html>
<head>
<title>Help</title>
</head>
<frameset cols="28%, 72%">
<frameset rows="8%, 92%">
<frame noresize="noresize" src="Buttons.html" name="UPPERLEFT" />
<frame noresize="noresize" src="mytest2.html" name="LOWERLEFT" />
</frameset>
<frame noresize="noresize" src="mytest.html" name="RIGHT" />
</frameset>
</html>
mytest.html:
<html>
<body>
<p>
<b>This text is bold</b>
</p>
<p>
<strong>This text is strong</strong>
</p>
<p>
<em>This text is emphasized</em>
</p>
<p>
<i>This text is italic</i>
</p>
<p>
<small>This text is small</small>
</p>
<p>This is
<sub>subscript</sub> and
<sup>superscript</sup></p>
</body>
</html>
mytest2.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h2>The blockquote Element</h2>
<p>The blockquote element specifies a section that is quoted from another source.</p>
<p>Here is a quote from WWF's website:</p>
<blockquote cite="http://www.worldwildlife.org/who/index.html">For 50 years, WWF has been protecting the future of nature. The
world’s leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United
States and close to 5 million globally.</blockquote>
<p>
<b>Note:</b> Browsers usually indent blockquote elements.</p>
<h2>The q Element</h2>
<p>The q element defines a short quotation.</p>
<p>WWF's goal is to:
<q>Build a future where people live in harmony with nature.</q> We hope they succeed.</p>
<p>
<b>Note:</b> Browsers insert quotation marks around the q element.</p>
</body>
</html>
buttons.html:
![<html>
<body>
<center>
<table>
<tr>
<td>
<form method="link" action="mytest.html" target="LOWERLEFT">
<input type="submit" value="Contents" />
</form>
</td>
<td>
<form method="link" action="mytest2.html" target="LOWERLEFT">
<input type="submit" value="Index" />
</form>
</td>
</tr>
</table>
</center>
</body>
</html>][2]
Taken from the official wkhtmltopdf issues area from a code project member’s answer; emphasis is mine:
wkhtmltopdf calculates the TOC based on the H* (e.g. H1, H2 and so on)
tags in the supplied documents. It does not recurse into frames and
iframes.. It will nest dependend on the number, to make sure that it
does the right thing, it is good to make sure that you only have
tags under a tag and not for some k larger
then 1. 2000+ files sounds like a lot. You might run out of memory
while converting the output. If it does not work for you.. you could
try using the switch to dump the outline to a xml file, to see what it
would but into a TOC.
I am trying to search the webpage for particular strings, and I am using the following code:
strPageContent = appIE.document.documentElement.InnerHTML
However, the page is quite complicated and has got a lot of frames and framesets, and the command above returns only the contents of some parents tag. How can I access the contents of the particular div element - please see the code below:
<html>
<head>...</head>
<frameset id="NavContent_Workhorse" frameborder="0" framespacing="0" rows="*,0">
<frameset id="Nav_Content" border="3" frameborder="1" framespacing="3" cols="240,*">
<frame name="nav" src="/interface/sidebar/sidebar.def" scrolling="no">
<frame name="content" src="/interface/home.def" frameborder="1" border="3" marginheight="0" marginwidth="0" scrolling="no">
#document
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang>
<head> … </head>
<body onload="LoadAdd();">
<div class="PageTitle" id="PageTitle">...</div>
<div class="ToolBar" id="PageBody">...</div>
<div id="error" class="none"> … </div>
<div id="content" style="display: block; height: 445px;">
<form id="frmUSR" method="post" target="workhorse" onsubmit="return false;" action="/setup/users_groups/users/insert.sdl?parentid=14">
<div id="wiz_1" class="wiz_vis">
<table class="frmTbl">
<thead class="title">
<tr>
<th class="label">
TEXT THAT I AM LOOKING FOR
</th>
Thanks in advance!
Edit:
I forgot to add that I did try the code below, but I get a null value
Set div = appIE.document.getElementById("wiz_1")
Edit 2:
The purpose of the script is to automate filling out the user creation forms on my company's system (webpage UI). I don't know why, but I cannot get a reference to anything that is below the main <frameset id="Nav_Content" border="3". I keep getting null values.
You can access the content of an element with a particular ID inside a frame like this:
Set frame = appIE.Document.parentWindow.window.frames("content")
Set div = frame.document.getElementById("wiz_1")
WScript.Echo div.innerHTML
WScript.Echo div.innerText
Outlook by default transforms ":)" into "J". Googling has revealed that J is the Wingdings character for the smilie, so they appear like normal smilies to Outlook users.
I want to transform these "J" smilies into the UTF-8 smiley characters so the rest of us can see them too. But when looking at the source of an email, the "J" smilie lines look like this:
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">J<o:p></o:p></span></p>
That is, just like normal Outlook formatting that you see on every other line. No font-family other than Calibri and Times New Roman is even mentioned anywhere in the source. So just how is Outlook decoding these J's back into smilies? How do I?
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
#font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
#font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.dp-replycode
{mso-style-name:dp-replycode;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
#page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Some message
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">J<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
....
I'm just an idiot. I was using client data as a source of Outlook emails since I didn't readily have an Outlook client available. After setting it up and testing for myself, the family:Wingdings is indeed in the source. Turns out the client was just signing his emails with "J"!
Now it's simple enough looking for font-family:Wingdings and converting them into UTF-8 smilies.