Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 10th, 2003, 03:35 PM
jayordan jayordan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 jayordan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Create a html file from Visual basic

I am working in Access 2000 and was wondering if anyone knows how to create a HTML file in Visual Basic?

The goal is to pass a variable to the HTML File in VB and then create/save the html file, attach that file and send an email message.

Any Help would be appreciated.

Reply With Quote
  #2  
Old November 10th, 2003, 07:21 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,171 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 37 sec
Reputation Power: 110
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
well, if you can use an Outlook object, then there is a method of the application object that is called "HTMLBody" where you can pass in an HTML string that will build a HTML page "on-the-fly"...

I have also built other applications using the CDO object and the SMTP ActiveX control and simply passed in an HTML string as the body. It will work (sometimes) if the client has an HTML enabled mail client.

If you have access (no pun intended), then I would use the Outlook object of MSOffice. It's very simple to use.
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
  #3  
Old November 10th, 2003, 09:25 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,712 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 31 m 33 sec
Reputation Power: 688
You can use Access built-in export to html to create an html file on disk, and then use CDO or some other email component to create an email message & attach the previously exported file.

Reply With Quote
  #4  
Old November 11th, 2003, 09:39 AM
jayordan jayordan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 jayordan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Create an actual HTML FILe

Well all I want to do is to create an HTML File form Visual Basic, actually create the file and attach it to an email. I am doing this because I want to send multiple invoice type html documents to a person in our organization so that they can look at them easily.

Reply With Quote
  #5  
Old November 11th, 2003, 11:41 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,171 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 37 sec
Reputation Power: 110
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
I see... can you simply open a freeform file, build an HTML string, print it to the file, and then close it? I did this in the form load event of a new VBapp

Code:
Private Sub Form_Load()
Dim strHTML As String
strHTML = "<HTML><HEAD><TITLE>This is the Title</TITLE></HEAD><BODY>This is the body</BODY></HTML>"
Open "C:\Documents and Settings\All Users\Desktop\Sample.html" For Append As #1
Print #1, strHTML
Close #1
End Sub

Last edited by Fisherman : November 11th, 2003 at 12:32 PM.

Reply With Quote
  #6  
Old November 11th, 2003, 11:27 PM
sir_drinxalot's Avatar
sir_drinxalot sir_drinxalot is offline
Known to taste like chicken
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: In front of my computer
Posts: 228 sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 13 h 53 m 3 sec
Reputation Power: 18
Send a message via MSN to sir_drinxalot
Facebook
im probably wrong here but, i think you would have to open the file for output not append wouldnt you, because otherwise it would just add your new data to the bottom of the file, and therefore it being html would show the old data (page) all the time, instead of the new data. If you open a file for output it overwrites the data in the file, so would in theory work better....as i said, i may be wrong, but thats my 2 cents

Reply With Quote
  #7  
Old November 12th, 2003, 08:39 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,171 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 37 sec
Reputation Power: 110
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
You are correct, for the most part, anyway. If it you are authoring the file and not changing it, then all you have to do is do an append... append will write to the file whether anything is in it or not, if there is, then it will write at the end of the existing file. I'm not concerned with this since I would ordinarily just delete and rebuild the file anyway if I needed to change it, instead of using processing time to look for a particular line of text that I wanted to change.

Reply With Quote
  #8  
Old November 13th, 2003, 01:04 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Yes!FisherMan!It's a easy way that Read the old file's content,Delete the old file,And write the old file's content and new content to a new file!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Create a html file from Visual basic


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway