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:
  #1  
Old October 21st, 2003, 11:25 PM
melinda melinda is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 76 melinda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 56 m
Reputation Power: 5
howto do global attachment files

Does any one know howto do global attacment

Iam trying to do
Call oItem.EMBEDOBJECT(1454, "", "c:\temp\*.txt"

but it does not work could some one show me how to do this

THX

Reply With Quote
  #2  
Old October 21st, 2003, 11:34 PM
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
U can't use "*" to represent any file with same extend name..U can get each filename that u want,and add it into your oItem..

Reply With Quote
  #3  
Old October 22nd, 2003, 02:16 AM
josephg josephg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: sydney
Posts: 47 josephg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 24 sec
Reputation Power: 6
I have tried this also but it does not work could you show us how do you do this, what are the codes you are using

Reply With Quote
  #4  
Old October 22nd, 2003, 02:56 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
OK!Give U a sample to show how to collect the wildcard file (like *.txt) in the special directory..

dim fso
dim fFolder
dim file
set fso=createobject("Scripting.filesystemobject")
if fso.FolderExists("C:\dir1") =true then
Set fFolder = fso.GetFolder("C:\dir1")
for each file in fFolder.files
if ucase(right(file.path,3))="txt" then
msgbox(file.path)
endif
next
End If

set file=nothing
set fFolder=nothing
set fso=nothing

Reply With Quote
  #5  
Old October 23rd, 2003, 02:06 AM
josephg josephg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: sydney
Posts: 47 josephg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 24 sec
Reputation Power: 6
I have tried your code but not sure where about or how on my program I can use them

Please note I am just a beginner please show me with what I know in my program, I'll apreciate your help.

Reply With Quote
  #6  
Old October 23rd, 2003, 09:20 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
OK! My code works by using vbscript language's filesystem ojbect.U can learn it on the msdn or vb help..I will expain my code now:

'define vbscript filesystem object
dim fso
dim fFolder
dim file
'create fielsystem object
set fso=createobject("Scripting.filesystemobject")
'check "C:\dir1" exists or not exists
if fso.FolderExists("C:\dir1") =true then
'if "C:\dir1" exists,it will assign a folder object that represent this folder
Set fFolder = fso.GetFolder("C:\dir1")
'asssign the file object in this directory,and search each file which filename contains "txt"
for each file in fFolder.files
'if find,it will show it in the messagebox
if ucase(right(file.path,3))="txt" then
msgbox(file.path)
endif
next
End If

'release the file object
set file=nothing
'release the folder object
set fFolder=nothing
'release the filesystem object
set fso=nothing

Reply With Quote
  #7  
Old October 23rd, 2003, 07:22 PM
josephg josephg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: sydney
Posts: 47 josephg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 24 sec
Reputation Power: 6
Thx for explanation now I understand little more about vb codes

About your sample code, when I run your code I get compile error with a message
"Ambiguous name detected Right" what can I do? and how can I resolve the problem, this is what I have create in
c:\dir1
abc.txt, efg2.txt, lmnop.txt

Reply With Quote
  #8  
Old October 23rd, 2003, 08:31 PM
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
OH!U must use the "Option Explicit" in the head of the code?If use it,u can only modify the define statement as:
dim fso as new filesystemobject
delete the statement:set fso=createobject("Scripting.filesystemobject")

Note:U must add the MS script runtime to the reference.

Reply With Quote
  #9  
Old October 23rd, 2003, 09:46 PM
josephg josephg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: sydney
Posts: 47 josephg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 24 sec
Reputation Power: 6
You have indicate the MS script runtime what is it and how can I add the MS script runtime to the refrence.
where about on your script I need to added

Reply With Quote
  #10  
Old October 23rd, 2003, 10:37 PM
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
project->reference->Search MS script runtime-> add it...

Reply With Quote
  #11  
Old October 23rd, 2003, 10:50 PM
josephg josephg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: sydney
Posts: 47 josephg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 24 sec
Reputation Power: 6
I am using excel 2000 and using tools>macro to run the macro

I can not find
project->reference->Search MS script runtime-> add it...

But I added from
tools>macro>tools>refrence>search MS script runtime >it is added

After doing this change still I get the same error message
even with removing the previous line as you have mentioned

Last edited by josephg : October 23rd, 2003 at 11:51 PM.

Reply With Quote
  #12  
Old October 25th, 2003, 06:34 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
Can't use wildcard filename like *.txt in my code.My code is used to select some files which filename contain some special string like txt,And show the filename to user..

Reply With Quote
  #13  
Old November 25th, 2003, 12:01 AM
melinda melinda is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 76 melinda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 56 m
Reputation Power: 5
How to receive attachment file as a correct format

When I send an attachment using vb (an EXCEL file ) I receive it as a non excel type format file
How can I receive it as a normal excel file type

Reply With Quote
  #14  
Old November 25th, 2003, 12:26 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,179 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 10 h 3 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
Mel... What do you mean when you "send" an attachment. Are you mailing though VB and receiving a file that is not excel? This could probably use it's own post.
__________________
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
  #15  
Old November 25th, 2003, 04:39 PM
melinda melinda is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 76 melinda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 56 m
Reputation Power: 5
file type attachment

Hi Fisherman
Yes, when I send attachment (Excel file) through VB I receive the attachment but I get it as a text file colour, not in Excel format colour and shape normally excel attachment is in green

Also you mention about another post, please do not do this question will complement the ordinal question

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > howto do global attachment files


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