Cancel fax in vbscript - vbscript

I can't find a way to do this anywhere, not even a mention of it. But is there is a way to programmatically cancel a fax using, say, a faxserver or faxdocument object? My current code looks something like this:
Set doc=CreateObject("FaxComEx.FaxDocument")
Set server=CreateObject("FaxComEx.FaxServer")
server.Connect ""
doc.Body="c:\somefile.txt"
doc.DocumentName="test fax"
doc.Recipients.Add "1555555555555"
doc.Priority = 1
doc.ConnectedSubmit(server)
Using the faxserver.faxserver and faxserver.faxdoc objects doesn't look much more promising, as the only faxdoc method I see is Send. Is canceling a fax just not possible? Thanks!

A related class to FaxDocument is FaxOutgoingJob that has a Cancel method.
I've never used it myself but I think that what you have to do is to use the FaxAccountFolders object and it's OutgoingQueue property which has a GetJobs method.

Related

SonarJs still shows warning about postMessage cross-domain issue

The error message is "make sure this cross-domain message is being sent to the intended domain".
This check rule from RSPEC-2819
Authors should not use the wildcard keyword ( *) in the targetOrigin argument in messages that contain any confidential information, as otherwise there is no way to guarantee that the message is only delivered to the recipient to which it was intended.
I assume it demands * cannot be used as targetOrigin, But It still shows warning when I use intended domain as targetOrigin like below:
Please somebody can tell me how to pass this check,
Any help would be appreciated
This rule detects only if a method postMessage is invoked on an object with a name containing window in it. Source code: PostMessageCheck.java. To bypass it, just assign your contentWindow object into different one, like this:
var content = this.elem.contentWindow;
content.postMessage('your message', window.location.origin);
Have faced similar issue in sonarQube. Below fix worked. Just get rid of using window object using directly.
Actual code:
window.parent.postMessage("data", parenturl);
Fix:
var content=window;
content.parent.postMessage("data",parenturl);

ICDevice not ready

I'm trying to write a simple Cocoa App to scan some documents from my USB-scanner. I use it the same way as this example of apple: https://developer.apple.com/library/mac/samplecode/ScannerBrowser/Listings/AppController_m.html
The 'deviceBrowser:didAddDevice...' method is called. There I set the scanners delegate to self (like in the example), but the methods 'deviceDidBecomeReady' or 'scannerDeviceDidBecomeAvailable' are never called.
Is there anything I have forgotten?
Here is the code:
http://pastebin.com/NHZ0j5ze
Oh... reading the .h-files of the frameworks should still be the first option. The order was wrong and I forgot didOpenSessionWithError.
Here is the working code:
http://pastebin.com/NDEY5S13

Set Outlook MailItem as read or suppress_receipt in PR_MESSAGE_FLAGS

What's the proper way to set a MailItem as read before opening or set the value suppress_receipt in PR_MESSAGE_FLAGS?
Looking at http://msdn.microsoft.com/en-us/library/office/cc815395(v=office.12).aspx my code is:
MailItem x = item as MailItem;
x.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E070003",35);
I got 35 from other read mails using OutlookSpy, assuming it contains the boolean flag for "Read".
Running this code gets me the exception "The operation failed".
Any ideas?
Thanks.
You cannot do that in the Outlook Object Model. On the MAPI level, you need to call IMessage::SetReadFlag(SUPPRESS_RECEIPT), but you will need C++ or Delphi for that.
If using Redemption (I am its author) is an option, you can use RDOMail.MarkRead(SuppressReceipt) (can be called from any language)
Use:
string PR_CLIENT_READ = "http://schemas.microsoft.com/mapi/proptag/0x0E070003"; omMailItem.PropertyAccessor.SetProperty(PR_CLIENT_READ, 0x09);
Worked for me..

Using callback functions in vbscript

I'm trying to make an update script for windows7 in vbscript
when invoking IUpdateSearcher::BeginSearch how do I pass the callback to ISearchCompletedCallback::Invoke Method?
I'm just clueless on this points:
do I need an function or sub or does this a custom object with an invoke method(and how to create)
how I need to pass the callback
is it even possible in vbscript (if not what is a good next step?)
Thanks
I've never tried it, but I'd look at the ConnectObject Method.
This article about scripting events might also be useful.
So maybe something like this (complete guess):
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
WScript.ConnectObject objSearcher, "searcherCallBack_"
objSearcher.BeginSearch ...
sub searcherCallBack_Invoke()
' handle the callback
end sub
I'd also suggest reading Guidelines for Asynchronous WUA Operations to make sure that you clean up after yourself.
that link also mentions using Windows Script Host, so it should definitely be possible to do this, though unless you need it to be asynchronous, the synchronous methods wouls probably be a easier.

Refactor my ruby snippet so it doesn't look like C anymore: method(method(param))

I have a class which uses a connection object to send the request data created by a request_builder object.
The code looks like this:
connection.send_request(request_builder.build_request(customer))
This in turn is called by
build_report(customer, connection.send_request(request_builder.build_request(customer)))
Ugly! Any ideas on how to make it more expressive? Usually in ruby and OOP we chain objects like this: "string".make_it_bigger.flash_it.send
It's code, that how it looks. But you can make yourself a favour by not trying to cram everything together on one line:
request = request_builder.build_request(customer)
response = connection.send_request(request)
report = build_report(customer, response)
if you told us more about your code base we might be able to suggest something else, but you don't give us very much to go on. What does the request_builder object do? Does connection.send_request(...) return a response? Why does a report need a customer and a response (assuming that's what is returned by connection.send_request(...)), and so on.
build_report(customer, request_builder.build_request(customer).send_over(connection))

Resources