Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default *How can you post a message to a newgroup from Excel??

I need to do the following:

1- Send a message to a newsgroup instead of an email
2- Make a different attachement for each message

ShellExecute 0&
This command ShellExecute 0& will open a new outlook email . How can I change the code to post a message to a newsgroup instead with a name of the newsgroup of xyz

Thank you in advance.

Here is the code for sending an email from excel. how can you change it to make it to send a message to a newsgroup????
================================================== ========================================
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 SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double

For r = 2 To 3 'data in rows 2-4
' Get the email address
Email = Cells(r, 2)

' Message subject
Subj = Cells(r, 1)
' Compose the message
Msg = Cells(r, 3)
' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")

' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus

' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add link to specific Excel worksheet in HTML Outlook message [email protected] Links and Linking in Excel 4 May 17th 23 11:47 AM
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message [email protected] Excel Discussion (Misc queries) 0 July 10th 06 03:07 PM
Excel file with hyperlinks takes a long time to open over the network Didier P Links and Linking in Excel 3 July 4th 06 04:39 PM
Fix too few data fields error message when merging excel and word ARY Excel Discussion (Misc queries) 0 October 17th 05 08:51 PM
Excel error message John Excel Discussion (Misc queries) 3 June 21st 05 05:52 AM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"