Hi I am new to this forum, and have been out of programming VB for quite some years, so some things are a bit rusty :)
But I have a problem concatenating two strings in VB6.
Here's what I want to do, I've made a Outlook COM-plugin which should save a selected e-mail to a fileserver. The file-name depends on the received date/time of the e-mail and two variable user-inputs. The directory-name on the fileserver is saved in an ini-file. I read the ini-file using a function in a module:
In the formcode I call the line containing the location with: (with strAfdeling being a variable depending on the department)
This is a snippet of the code where the problem occurs:
The result I am expecting is something like:
R:\Bla\Bladibla\RefCstDate.msg
But the result VB gives me is:
R:\Bla\Bladibla\
If I first change the last line to:
It does give me:
RefCstDateR:\Bla\Bladibla\.msg
:confused:
Any thoughts on what I should change to make it work properly? Am I misdeclaring anything?
Any help would be very much welcome! :)
But I have a problem concatenating two strings in VB6.
Here's what I want to do, I've made a Outlook COM-plugin which should save a selected e-mail to a fileserver. The file-name depends on the received date/time of the e-mail and two variable user-inputs. The directory-name on the fileserver is saved in an ini-file. I read the ini-file using a function in a module:
Code:
Public Function LaadPubl(Section As String, Key As String) As String
Dim lngResult As Long
Dim strFileName
Dim strResult As String * 300
strFileName = "U:\BASKoppelQ\instelling.ini"
lngResult = GetPrivateProfileString(Section, Key, strFileName, strResult, Len(strResult), strFileName)
Check = "U:\BASKoppel\sets.ini"
LaadPubl = Trim(strResult)
End Function
Code:
strPathname = LaadPubl(strAfdeling, "opslag")
Code:
Dim strReceivedTime As String
Dim strPathname As String
Dim strPadBestand As String
Dim strSubject As String
Dim strReferentieAs String
Dim strCst_cd As String
Dim intPadFile As Integer
Dim strAfdeling As String
strPathname = LaadPubl(strAfdeling, "opslag")
For Each olkItem In Application.ActiveExplorer.Selection
If olkItem.Class = olMail Then
strReceivedTime = olkItem.ReceivedTime
strReceivedTime = Format(ReceivedTime, "DDMMYYYYHHmmSS")
strSubject = UCase(strReferentie) & "$" & strCst_cd & "_" & strReceivedTime
'Calling a function to replace illegal characters from the subject-string
strSubject = ReplaceIllegalCharacters(strSubject)
strPadBestand = strPathname & strSubject & ".msg"
R:\Bla\Bladibla\RefCstDate.msg
But the result VB gives me is:
R:\Bla\Bladibla\
If I first change the last line to:
Code:
strPadBestand = strSubject & strPathname & ".msg"
RefCstDateR:\Bla\Bladibla\.msg
:confused:
Any thoughts on what I should change to make it work properly? Am I misdeclaring anything?
Any help would be very much welcome! :)