Reply
Thread Tools
Posts: 1 | Thanked: 0 times | Joined on Sep 2007
#11
Just tried printing on my 770 and got it to work. Here's how

1 > Create a rule in Outlook (at work) to run a script whenever it receives an email with nokia770 as the title and has an attachment

2 > Nicked (!) a script from another forum and added it to Outlook (Open outlook, Press ALT and F11, Place it in the ThisOutlookSession part of project tree on left)

3 > Close reopen Outlook

4 > Set to print on my printer (I did it via a network printer/http to home but will work on local printer)


Any questions, please ask!

There must be a way we can do this without relying on M$
Come on everyone! Let's get to work

---------------------------------

Code:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub printAttachment(Item As Outlook.MailItem)



Dim myItems, myItem, myattachments, myAttachment As Object
Dim myOrt As String
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim strFile As String

'Set destination folder
myOrt = "C:\program files\microsoft office\"


On Error Resume Next
'work on selected items
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection
'for all items do...
For Each myItem In myOlSel
'point on attachments
Set myattachments = myItem.Attachments
If myattachments.Count > 0 Then
'for all attachments do...
For i = 1 To myattachments.Count
'save them to destination
myattachments(i).SaveAsFile myOrt & myattachments(i).DisplayName
strFile = myOrt & myattachments(i).DisplayName

ShellExecute 0&, "print", strFile, 0&, 0&, 0&
NextOne:

Next i

myItem.Save

End If
Next
Set myItems = Nothing
Set myItem = Nothing
Set myattachments = Nothing
Set myAttachment = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing



End Sub
 
Texrat's Avatar
Posts: 11,700 | Thanked: 10,045 times | Joined on Jun 2006 @ North Texas, USA
#12
Nicely done.

Somewhere I have a post about dumping images from the N800 to bluetooth printers. So there's 2 workarounds...
__________________
Nokia Developer Champion
Different <> Wrong | Listen - Judgment = Progress | People + Trust = Success
My personal site: http://texrat.net
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#13
Originally Posted by tuxtorials.com View Post
Just tried printing on my 770 and got it to work. Here's how

1 > Create a rule in Outlook (at work) to run a script whenever it receives an email with nokia770 as the title and has an attachment
Nice! But what if a spammer or ddos'er figures out your email address and the trick with nokia770 in the subject.. this would elevate spam to a new level, by forcing your printer to print spam ads to you!
(Kind of like the old fax spamming)
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:53.