VBA Express Forum  




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade Knowledge Base Training Articles Consulting

Reply
 
Thread Tools Display Modes
Old 04-16-2012, 12:18 PM   #1
Klartigue

 
Joined: Aug 2011
Posts: 308
Kb Entries: 0
Articles: 0
Send a fax

Is there a way to fax something via the computer? Such as setting something up as an attachment to an email (see below vba) but instead of sending the attachment in an email could it fax it to a certain fax number?

VBA:
Sub SendMail() Dim oOutlook As Object Dim oMailItem As Object Dim oRecipient As Object Dim oNameSpace As Object Dim Lastrow As Long Dim bodyText As String Dim i As Long Set oOutlook = CreateObject("Outlook.Application") Set oNameSpace = oOutlook.GetNameSpace("MAPI") oNameSpace.Logon , , True Set oMailItem = oOutlook.CreateItem(0) With oMailItem Set oRecipient = .Recipients.Add("klartigue@avalonadvisors.com") oRecipient.Type = 1 .Subject = "Avalon Trade Allocations Attached" .body = "Please see the attached trade allocations." & vbNewLine & vbNewLine & _ "Let me know if you need anything else." & vbNewLine & vbNewLine & _ "Thanks, " & vbNewLine & vbNewLine & _ "Katherine Lartigue " & vbNewLine & _ "klartigue@avalonadvisors.com 713-238-2088" .Attachments.Add ("G:\Katherine Lartigue\Allocations\Merrill Lynch Trades.xls") .Send End With End Sub
VBA tags courtesy of www.thecodenet.com

Local Time: 09:05 PM
Local Date: 05-18-2013
Location:

 
Reply With Quote Top
Old 04-16-2012, 12:46 PM   #2
Klartigue

 
Joined: Aug 2011
Posts: 308
Kb Entries: 0
Articles: 0
I have somethiing like this but it says I need a fax service. Is there a way to go about this without using a fax service?

VBA:
Sub Fax() ActiveWorkbook.SendFaxOverInternet _ "Thomas Giles @ 17132382051", _ "Please process the enclosed trade ticket. Thanks, Katherine Lartigue ", True End Sub
VBA tags courtesy of www.thecodenet.com

Local Time: 09:05 PM
Local Date: 05-18-2013
Location:

 
Reply With Quote Top
Old 04-16-2012, 12:54 PM   #3
Klartigue

 
Joined: Aug 2011
Posts: 308
Kb Entries: 0
Articles: 0
And i did make sure that on excel, the windows fax feature is enabled.

Local Time: 09:05 PM
Local Date: 05-18-2013
Location:

 
Reply With Quote Top
Old 04-16-2012, 12:57 PM   #4
Kenneth Hobs
 
Kenneth Hobs's Avatar

 
Joined: Nov 2005
Posts: 2,849
Kb Entries: 2
Articles: 0
Just send it to MSWord and then print to your fax printer.

Local Time: 12:05 AM
Local Date: 05-19-2013
Location:

 
Reply With Quote Top
Old 04-16-2012, 01:36 PM   #5
Klartigue

 
Joined: Aug 2011
Posts: 308
Kb Entries: 0
Articles: 0
I am trying to fax to an outside source so if I print to my fax printer, at what point do i enter the outside fax # im trying to fax to?

Local Time: 09:05 PM
Local Date: 05-18-2013
Location:

 
Reply With Quote Top
Old 04-16-2012, 01:49 PM   #6
Kenneth Hobs
 
Kenneth Hobs's Avatar

 
Joined: Nov 2005
Posts: 2,849
Kb Entries: 2
Articles: 0
Like all print operations, you will get a print dialog. You can probably use SendKeys() to fill it.

Here is what I got when I recorded it.
VBA:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _ IgnorePrintAreas:=False
VBA tags courtesy of www.thecodenet.com

You can then run your Outlook operation to send the emails.

Local Time: 12:05 AM
Local Date: 05-19-2013
Location:

 
Reply With Quote Top
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 10:05 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2012 VBA Express