View Single Post
  #3  
Old March 20th 06, 11:10 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_vba
windandwaves
external usenet poster
 
Posts: 18
Default installing VB script

Sue Mosher [MVP-Outlook] wrote:
Copy and paste it into a Notepad text file and email that file to him
along with instructions for how to copy and paste the code into a
module in the Outlook VBA environment.


Hey Sue,
thank you for your reply. much appreciated. is there anything more
sophisticated then the method you outline above? my client is a novice,
novice and I would prefer a simple installer as it would look more
professional.

TIA

Nicolaas


PS my next question is how I can create a button in outlook that calls the
code.


FYI, there is a newsgroup specifically for general Outlook
programming issues "down the hall" at
microsoft.public.outlook.program_vba or, via web interface, at
http://www.microsoft.com/office/comm....program_v ba


"windandwaves" wrote in message
...
Hi Gurus

I have written a piece of VB script (see below). I want to send
this to a client so that he can install it. My question is, how can
I send that best. I know they have access so should i put it in
access and then export from there into outlook?

Any help greatly appreciated (this is all new to me)

Nicolaas




Sub CreateHTMLMail()
'Creates a new e-mail item and modifies its properties.
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = go()
.Display
End With
End Sub



Function go()
Dim Fs
Dim A
Dim PathandFile As String
'-
PathandFile = "c:\testfile.htm"
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.OpenTextFile(PathandFile)
'read rest of the file
Do While A.AtEndOfStream True
ReadFile = ReadFile & Trim(A.ReadLine)
Loop
A.Close
'-check last line
go = strtext
End Function



Ads