Convert forms code to DLL

H

hjpal

In some outlook forms running on OL97 and OL2000 I use some vbscript code.
Is it possible to convert this script code into a DLL
and then in the events access the DLL with "createobject"?
 
S

Sue Mosher [MVP]

In what events where?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
H

hjpal

Code like this

CONST AOF_ID =
"000000001A447390AA6611CD9BC800AA002FC45A0300C0B86B30DBD611CEB31700AA00574CC
60000000000030000"
const WWWROOT ="\\NTS01\OL\": ForReading=1: ForWriting=2: ROOTFILE =
"wwwroot.txt"

Function Item_Open()
Dim arr, nxd
Dennebruger=application.getnamespace("mapi").currentuser.name
wrxcode = Laesfil(Getcode(code))
if code <> "" then
Redigerret = 1
end if
' Ikke mere check hvis bruger alene har læseret
if redigerret <> 1 then exit function

if application.activeexplorer.currentfolder.parent ="Web Redaktion" then
Folder = application.activeexplorer.currentfolder
tempfolder = folder
else
Folder = application.activeexplorer.currentfolder.parent
tempfolder = application.activeexplorer.currentfolder
end if
emnenavn = tempfolder

RegExpTest("[æøå]"),(tempfolder)
htmtempnavn = "$" & tempfolder & ".htm"

IF STAMOPLYSNINGER(emnenavn) = FALSE THEN
MSGBOX(emnenavn & " FILEN FINDES IKKE")
EXIT FUNCTION
END IF

tempfil = WWWROOT & "temp\" & htmtempnavn
konvfil = WWWROOT & FOLDER & "\" & htmfilnavn

Opret_item

IF Subbruger <> dennebruger THEN
msgbox EMNENAVN & " redigeres i øjeblikket af " & Subbruger &
chr(13)&_
"Du har ikke skriveret før denne lukker " & EMNENAVN & chr(13)
& chr(13)&_
EMNENAVN & " skal herefter lukkes og åbnes for at få
skriveret" & chr(13) & chr(13)&_
"Redigering påbegyndt " & opretdato
Ingenskriveret = 1
END IF

End Function



"Sue Mosher [MVP]" <[email protected]> skrev i en meddelelse
In what events where?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

Yes, this is typically done with a COM add-in that loads when Outlook starts. Note that each machine would need that add-in installed. However, Outlook 97 does not support COM add-ins, so you'd need some ..dll that can operate as a simple COM object (I can't explain it well, but I'm sure a VB forum can.)

hjpal said:
Code like this

CONST AOF_ID =
"000000001A447390AA6611CD9BC800AA002FC45A0300C0B86B30DBD611CEB31700AA00574CC
60000000000030000"
const WWWROOT ="\\NTS01\OL\": ForReading=1: ForWriting=2: ROOTFILE =
"wwwroot.txt"

Function Item_Open()
Dim arr, nxd
Dennebruger=application.getnamespace("mapi").currentuser.name
wrxcode = Laesfil(Getcode(code))
if code <> "" then
Redigerret = 1
end if
' Ikke mere check hvis bruger alene har læseret
if redigerret <> 1 then exit function

if application.activeexplorer.currentfolder.parent ="Web Redaktion" then
Folder = application.activeexplorer.currentfolder
tempfolder = folder
else
Folder = application.activeexplorer.currentfolder.parent
tempfolder = application.activeexplorer.currentfolder
end if
emnenavn = tempfolder

RegExpTest("[æøå]"),(tempfolder)
htmtempnavn = "$" & tempfolder & ".htm"

IF STAMOPLYSNINGER(emnenavn) = FALSE THEN
MSGBOX(emnenavn & " FILEN FINDES IKKE")
EXIT FUNCTION
END IF

tempfil = WWWROOT & "temp\" & htmtempnavn
konvfil = WWWROOT & FOLDER & "\" & htmfilnavn

Opret_item

IF Subbruger <> dennebruger THEN
msgbox EMNENAVN & " redigeres i øjeblikket af " & Subbruger &
chr(13)&_
"Du har ikke skriveret før denne lukker " & EMNENAVN & chr(13)
& chr(13)&_
EMNENAVN & " skal herefter lukkes og åbnes for at få
skriveret" & chr(13) & chr(13)&_
"Redigering påbegyndt " & opretdato
Ingenskriveret = 1
END IF

End Function



"Sue Mosher [MVP]" <[email protected]> skrev i en meddelelse
In what events where?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



hjpal said:
In some outlook forms running on OL97 and OL2000 I use some vbscript code.
Is it possible to convert this script code into a DLL
and then in the events access the DLL with "createobject"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top