|
-
Apr 18th, 2003, 10:39 AM
#1
Thread Starter
Fanatic Member
...Outlook Vb
I am currently sending an e-mail via VB to a client...
I would like to save this sent message into a corresponding folder automatically...
Any ideas?
-
Apr 18th, 2003, 11:42 AM
#2
use the 'SaveSentMessageFolder' property of the email mesage.
Set the property of the email equal to the MAPI folder where you
want to have the copy saved to.
Code:
Set oEmail.SaveSentMessageFolder = oApp.oNS.oSent
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 12:26 PM
#3
Thread Starter
Fanatic Member
remember
Remember Rob
I am sending via IE... How do I know that the user has not hit Cancel instead of sent
ls_Browser = FindDefaultBrowser
Shell ls_Browser & " mailto:" & strEMail1Address & "?subject=" & "[Sent via ACMS]"
-
Apr 18th, 2003, 01:08 PM
#4
Thread Starter
Fanatic Member
Me again
I just switch to the following
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = strEMail1Address
.Subject = "[Sent via ACMS]"
.Importance = olImportanceHigh
.Display 1
Set .SaveSentMessageFolder = gf_olfolder
Now
The gf_olfolder is a subfolder in ALL PUBLIC FOLDERS which is
a subfolder under PUBLIC FOLDERS
What should gf_folder be ? Just the name of the folder
How does one specify full folder path
Thanks
-
Apr 18th, 2003, 03:06 PM
#5
I think that using the Outlook object model is the best way to go
if yuo need total control. If you need to save the sent item to
a public folder then do this.
Code:
'In your procedure, drill down the path
Dim oApp As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oPF As Outlook.MAPIFolder
Dim oAPF As Outlook.MAPIFolder
Dim ogf_olfolder As Outlook.MAPIFolder
Set oNS = oApp.GetNamespace("MAPI")
Set oPF = oNS.Folders("Public Folders")
Set oAPF = oPF.Folders("All Public Folders")
Set ogf_olfolder = oAPF.Folders("ogf_olfolder")
Set oEmail.SaveSentMessageFolder = ogf_olfolder
Set oApp = Nothing
Set oNS = Nothing
Set oPF = Nothing
Set oAPF = Nothing
Set ogf_olfolder = Nothing
'Then go on to send your email
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 03:36 PM
#6
Banned
This is close...but what if Outlook is closed?
Its better to check if outlook is opened on the user end...otherwise the user will get a security permission error.
Check if outlook is open..if not open it on the client side send the email and then close it.
Jon
-
Apr 18th, 2003, 04:19 PM
#7
That is not correct. The statement of code -
Code:
Dim oApp As New Outlook.Application
will create an instance of Outlook, so if the user is already in
Outlook, this will attach to it.
Otherwise it will be a New separate process and the user will
have to select the profile to log on with.
My example was just a partial procedure for him to incorporate
into his procedure.
Late.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 04:22 PM
#8
Banned
Originally posted by RobDog888
That is not correct. The statement of code - [code
Late.
Wanna put your bottom dollar on this one? If outlook is not running as a process (PID) on a client machine than an error message will pop up AS LONG AS the programmer has caught the exception, i.e:
VB Code:
on error goto err_handler
done:
exit sub
err_handler:
msgbox err.description,vbcritical, "error #: " & err.number
resume done
Just because you have created an outlook object...does not mean your email will be sent..in fact it IS NOT sent. Outlook or your standard e-mail client needs to be open at the time you instantiate an Outlook object.
Jon
-
Apr 18th, 2003, 05:06 PM
#9
I would put money on it because I just double checked.
I depends upon what you are trying to do in Outlook.
If you are trying to create email and send it on a client machine
in an Exchange enviroment, then it will create a new instance
of Outlook, but not visible unless your code specifies it. It WILL
send the email(s). If you are trying to connect to public forders,
then you will need to login with your profile through code.
I can admit that I didn't realize that he would need to do that
because he wants to save a copy of the email in a public folder
on his exchange server, but for sending emails, it does work.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 05:18 PM
#10
Originally posted by RobDog888
That is not correct. The statement of code -
Code:
Dim oApp As New Outlook.Application
will create an instance of Outlook
I don't want to be this picky really but I can't help myself because I'm bored 
Setting an object (any object) as New together with the declaration will actually not create an instance of that object. Instead it will be created on first use. In other words the first time you use a property or call a method of that object.
This will actually slow down the process of working with that object because every time you use the object VB first have to check if it has created an instance or not. So the best way to create an object is to first declare it and then set it to new, in that case VB will create the object and no extra checks are necessary when using it.
VB Code:
Dim obj As Something
Set obj = New Something
Of course you would have to type an extra line of code
-
Apr 18th, 2003, 05:24 PM
#11
Joacim,
I read somewhere that declaring the variable with the New was a
resource saver. I used to code it that way until I was informed
on the way that I posted. It sound like your way is perhaps the
correct way. One extra line of code won't kill me.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 05:29 PM
#12
Originally posted by RobDog888
Joacim,
I read somewhere that declaring the variable with the New was a
resource saver. I used to code it that way until I was informed
on the way that I posted. It sound like your way is perhaps the
correct way. One extra line of code won't kill me.
Well, yeah... Setting an object as new on the declaration line could save some resources since the object will not be created unless it's used (this then comes with the performance hit I explained in my earlier post). But if you know you're going to use the object then it's always better to make sure an instance exists so your code will run a bit faster.
-
Apr 18th, 2003, 05:30 PM
#13
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 06:14 PM
#14
Banned
Originally posted by RobDog888
I would put money on it because I just double checked.
I depends upon what you are trying to do in Outlook.
If you are trying to create email and send it on a client machine
in an Exchange enviroment, then it will create a new instance
of Outlook, but not visible unless your code specifies it. It WILL
send the email(s). If you are trying to connect to public forders,
then you will need to login with your profile through code.
I can admit that I didn't realize that he would need to do that
because he wants to save a copy of the email in a public folder
on his exchange server, but for sending emails, it does work.
Well isnt that something...it works on his machine so he implies it works on every machine on any WIN OS. Sorry...I've done integration with exchange and outlook too long..not going to argue this one. It is NOT correct unless outlook is open...if you catch the exception you will see that outlook NEEDS to be running to send anything...if a profile pops up...what do you think that means? On our exchange server I get an error message no pop up...the pop up is asking you for security purposes your network ID as well as a password or what have you not. This is HOW OUTLOOK is opening.
Jon
-
Apr 18th, 2003, 07:39 PM
#15
Originally posted by jhermiz
Well isnt that something...it works on his machine so he implies it works on every machine on any WIN OS. Sorry...I've done integration with exchange and outlook too long..not going to argue this one. It is NOT correct unless outlook is open...if you catch the exception you will see that outlook NEEDS to be running to send anything...if a profile pops up...what do you think that means? On our exchange server I get an error message no pop up...the pop up is asking you for security purposes your network ID as well as a password or what have you not. This is HOW OUTLOOK is opening.
Jon
Ok, granted it doesn't work with the way that YOU have it
set up, but that does not mean that it doesn't work for anyone else.
Outlook can be configured may ways and it is difficult to develop
for every possible scenerio.
If it doesn't work for you unless Outlook is open, then perhaps
it could just possibly work for others even if they don't have Outlook open.
There is not a program that will not come accross an error on
every platform. If it is working for Lafor then it helped and if
it didn'nt then we can discuss other options to try. Is this not
what this forum is for?
BTW: I am running Outlook XP on Windows 2000 Pro on a
Windows 2000 Active Directory network with Outgoing Mail Server not requiring authentication.
Outlook configured as Corporate or Workgroup.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 18th, 2003, 07:56 PM
#16
I never had any problems creating a new Outlook.Application session either. Why wouldn't it work? However you might need to be validated by the Exchange server before you can send mail though. But you can definitly create a new Outlook session the way RobDog888 described.
-
Apr 21st, 2003, 09:29 AM
#17
Thread Starter
Fanatic Member
What is oEmail defined as?
Hello Guys!
oEmail should be defined as what?
-
Apr 21st, 2003, 12:52 PM
#18
Code:
Dim oEmail As Outlook.MailItem
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 12:57 PM
#19
Thread Starter
Fanatic Member
ok
This would not work... after I send the email
I get the message... Item has been moved or deleted
Set ogf_olfolder = oAPF.Folders("AHA")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = strEMail1Address
.Subject = "TEST"
.Display 1
Set .SaveSentMessageFolder = ogf_olfolder
End With
Any idea??? Am I missing something?
-
Apr 21st, 2003, 02:45 PM
#20
Check the public folder you want to save it to. I think it may have been renamed.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 02:47 PM
#21
Thread Starter
Fanatic Member
not really
I can go back to it and look at it..
Did it work for you?
-
Apr 21st, 2003, 02:53 PM
#22
It will not let me save a copy in the public folder I set it to.
It says 'Operation Failed!"
I think it may have to do with the public folders not allowing
Message types in public folders.
It will not let me change the default form to anything other than
post.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 02:57 PM
#23
Thread Starter
Fanatic Member
...
I got the same error message..
My guess is that the item is sent.. and is no longer available
to be copied or moved to another place...
Notice that the message is actually send, it's the save operation
that's failed...
I also notice that if I do
prior to the display
a SaveSentMessageFolder.copyto gf_oldfolder
It will move all the items in the sent box onto my destination folder.. I was actually trying to find a way to get the last item entered and do the move or the copy.. but, "item is not found either"
-
Apr 21st, 2003, 03:16 PM
#24
Is your Sent Items still on your personal folder list?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 03:17 PM
#25
Thread Starter
Fanatic Member
-
Apr 21st, 2003, 03:20 PM
#26
I accidentally renamed my Sent Items folder to Development.
I had created a public folder Development and was trying to
have the SaveSentMessages to this folder, but it renamed my
personal Sent tems folder to Development. I finally got it
renamed back.
I guess the copyto method is safer for the public folder.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 04:22 PM
#27
I go it working to send a copy to the public folder for the specific
item only.
My public folder is "Development". I used the .Copy and .Move
methods of the actual email as its being sent.
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim oEmail As Outlook.MailItem
Dim oNS As Outlook.NameSpace
Dim oPF As Outlook.MAPIFolder
Dim oAPF As Outlook.MAPIFolder
Dim oDev As Outlook.MAPIFolder
Dim oCopyEmail As Outlook.MailItem
Set oNS = Application.GetNamespace("MAPI")
Set oPF = oNS.Folders("Public Folders")
Set oAPF = oPF.Folders("All Public Folders")
Set oDev = oAPF.Folders("Development")
Set oEmail = Item
Set oCopyEmail = oEmail.Copy
oCopyEmail.Move oDev
Set oEmail = Nothing
Set oCopyEmail = Nothing
Set oNS = Nothing
Set oPF = Nothing
Set oAPF = Nothing
Set oDev = Nothing
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 04:36 PM
#28
Thread Starter
Fanatic Member
...
Thanks...
I'll try that,.... But what I have decided to do in the mean time
is to associate an e-mail to each of these folders and
upon sending the e-mail I bcc to the [email protected]
So the e-mail will be put in the mail box of the organization
I just had to modify the code to point to the INBOX of the organization rather than the public folder... But, I'll try it
Thanks a mil
-
Apr 21st, 2003, 05:00 PM
#29
Your welcome.
My method might be better for you. The receipient can not
see any info from the cc field and there is no information
embedded into the email message.
I really get into Outlook, as you can probably tell!
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2003, 05:02 PM
#30
Thread Starter
Fanatic Member
-
Apr 21st, 2003, 05:07 PM
#31
I like the challenge. So if you have anything concerning Outlook
or Office, don't hesitate to let me know.
I need new deeper areas to get into with Outlook.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 4th, 2003, 11:41 AM
#32
Thread Starter
Fanatic Member
Outlook forms
Me again..
I would like to copy some fields on an outlook form as is
and paste onto my VB form.. Is that doable?
-
Jun 4th, 2003, 12:14 PM
#33
Sure. Just "Find" to the item and read the properties you
need into your vb form.
Connect to the folder and use the .Find method to return the item.
Something like...
Code:
'INITIALIZE OUTLOOK CONNECTION
Set oApp = New Outlook.Application
Set oNS = oApp.GetNamespace("MAPI")
Set oTaskBox = oNS.GetDefaultFolder(olFolderTasks)
Set oItems = oTaskBox.Items
oItems.Find = "[Subject] = 'Test'"
txtSubject = oItems.Subject
txtCreatedDate = oItems.CreatedDate
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 4th, 2003, 12:16 PM
#34
The code needs to go behind your VB form not in Outlook VBA.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 4th, 2003, 03:31 PM
#35
PowerPoster
Well
Mt two cents :
Make sure Outlook is installed or it won't matter anyway...
VB Code:
' USED FOR THE EXISTANCE OF OUTLOOK '************************************************
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, ByVal cbName As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
' USAGE
' SEE IF OUTLOOK INSTALLED ON SYSTEM
Call OUTLOOKINSTALLED
Function OUTLOOKINSTALLED() As Boolean
OUTLOOKINSTALLED= False
Dim sKey As String * 255
Dim lRegKey As Long
Dim iKey As Integer
Call RegOpenKey(HKEY_LOCAL_MACHINE, "Software\Clients\Mail", lRegKey)
While RegEnumKey(lRegKey, iKey, sKey, 255) = 0
If Left(sKey, InStr(sKey, Chr(0)) - 1) = "Microsoft Outlook" Then
OUTLOOKINSTALLED = True
End If
iKey = iKey + 1
Wend
Call RegCloseKey(lRegKey)
End Sub
Last edited by James Stanich; Jun 4th, 2003 at 03:42 PM.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jun 4th, 2003, 03:38 PM
#36
Thread Starter
Fanatic Member
....
Was thinking of opening the task form in design mode and
cut/paste some fields into VB form...
But, Rob's idea could become veryhandy at some point...
Thanks
-
Jun 4th, 2003, 03:46 PM
#37
You can't copy and paste outlook controls to vb.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 4th, 2003, 03:49 PM
#38
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|