C
Christian Kjær
Hi all
I have designet an Outlook form in Outlook 2003 and it works very fine. But
when, I send it to my Outlook 2000 user it Only run some of the code. belov
I have postet the VBScript code. Can anybody se, what is wrong?
dim path
path = "J:\skabeloner\Outlook\Vikar\"
function startDokument(path)
dim objWord
dim objDoc
set objWord = createObject("Word.Application")
set objDoc = objword.documents.add(path)
objWord.visible = true
objWord.Selection.GoTo -1,,, "Fornavn"
objWord.Selection.TypeText
Item.UserProperties.item("FornavnTelefonscreening").value
on error resume next
objWord.Selection.GoTo -1,,, "Efternavn"
if err.number = 0 then
objWord.Selection.TypeText
Item.UserProperties.item("EfternavnTelefonscreening").value
objWord.Selection.GoTo -1,,, "Adresse"
objWord.Selection.TypeText
Item.UserProperties.item("AdrTelefonscreening").value
objWord.Selection.GoTo -1,,, "Postnummer"
objWord.Selection.TypeText
Item.UserProperties.item("PostnummerTelefonscreening").value
objWord.Selection.GoTo -1,,, "By"
objWord.Selection.TypeText
Item.UserProperties.item("ByTelefonscreening").value
end if
on error goto 0
'Sidehoved og sidefod
objWord.ActiveWindow.ActivePane.View.SeekView = 9
objWord.Selection.MoveDown 5, 1
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.ActiveWindow.ActivePane.View.SeekView = 0
objWord.Selection.GoTo -1,,, "Kontor2"
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.Selection.GoTo -1,,, "Kontor3"
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.Selection.GoTo -1,,, "OprettetAf"
objWord.Selection.TypeText cStr(Item.UserProperties.item("Forfatter").value)
if Item.UserProperties.item("emailTelefonscreening").value <> "" then
objWord.Selection.GoTo -1,,, "text"
objWord.Selection.TypeText "Inden samtalen vil jeg sende dig en test pr.
e-mail som du skal løse. Jeg sender dig testen på " &
Item.UserProperties.item("emailTelefonscreening").value & "." & chr(13) &
chr(10) & "Har du ikke modtaget testen inden samtalen, skal du kontakte
mig."
else
objWord.Selection.GoTo -1,,, "text"
objWord.Selection.TypeText "I forbindelse med samtalen, vil du blive
præsenteret for en test I afd."
end if
dim txt
txt = Item.UserProperties.item("lblStart").value
txt = weekdayName(weekday(txt)) & " den " & cStr(formatdateTime(txt, 1))
objWord.Selection.GoTo -1,,, "Start"
objWord.Selection.TypeText txt
txt = timeValue(Item.UserProperties.item("lblStart").value)
objWord.Selection.GoTo -1,,, "tid"
objWord.Selection.TypeText cStr(txt)
objWord.Selection.GoTo -1,,, "Dato"
objWord.Selection.TypeText cStr(formatDateTime(Date, 1))
set objDoc = nothing
set objWord = nothing
end function
sub cmdBrevTilKandidat_click()
startDokument path & "Indkaldselsbrev.doc"
end sub
sub cmdMailTilKandidat_click()
startDokument path & "Indkaldselsmail.doc"
end sub
Any help would be appeciated.
Kind regards
Christian
I have designet an Outlook form in Outlook 2003 and it works very fine. But
when, I send it to my Outlook 2000 user it Only run some of the code. belov
I have postet the VBScript code. Can anybody se, what is wrong?
dim path
path = "J:\skabeloner\Outlook\Vikar\"
function startDokument(path)
dim objWord
dim objDoc
set objWord = createObject("Word.Application")
set objDoc = objword.documents.add(path)
objWord.visible = true
objWord.Selection.GoTo -1,,, "Fornavn"
objWord.Selection.TypeText
Item.UserProperties.item("FornavnTelefonscreening").value
on error resume next
objWord.Selection.GoTo -1,,, "Efternavn"
if err.number = 0 then
objWord.Selection.TypeText
Item.UserProperties.item("EfternavnTelefonscreening").value
objWord.Selection.GoTo -1,,, "Adresse"
objWord.Selection.TypeText
Item.UserProperties.item("AdrTelefonscreening").value
objWord.Selection.GoTo -1,,, "Postnummer"
objWord.Selection.TypeText
Item.UserProperties.item("PostnummerTelefonscreening").value
objWord.Selection.GoTo -1,,, "By"
objWord.Selection.TypeText
Item.UserProperties.item("ByTelefonscreening").value
end if
on error goto 0
'Sidehoved og sidefod
objWord.ActiveWindow.ActivePane.View.SeekView = 9
objWord.Selection.MoveDown 5, 1
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.ActiveWindow.ActivePane.View.SeekView = 0
objWord.Selection.GoTo -1,,, "Kontor2"
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.Selection.GoTo -1,,, "Kontor3"
objWord.Selection.TypeText
Item.UserProperties.item("KontoTelefonscreening").value
objWord.Selection.GoTo -1,,, "OprettetAf"
objWord.Selection.TypeText cStr(Item.UserProperties.item("Forfatter").value)
if Item.UserProperties.item("emailTelefonscreening").value <> "" then
objWord.Selection.GoTo -1,,, "text"
objWord.Selection.TypeText "Inden samtalen vil jeg sende dig en test pr.
e-mail som du skal løse. Jeg sender dig testen på " &
Item.UserProperties.item("emailTelefonscreening").value & "." & chr(13) &
chr(10) & "Har du ikke modtaget testen inden samtalen, skal du kontakte
mig."
else
objWord.Selection.GoTo -1,,, "text"
objWord.Selection.TypeText "I forbindelse med samtalen, vil du blive
præsenteret for en test I afd."
end if
dim txt
txt = Item.UserProperties.item("lblStart").value
txt = weekdayName(weekday(txt)) & " den " & cStr(formatdateTime(txt, 1))
objWord.Selection.GoTo -1,,, "Start"
objWord.Selection.TypeText txt
txt = timeValue(Item.UserProperties.item("lblStart").value)
objWord.Selection.GoTo -1,,, "tid"
objWord.Selection.TypeText cStr(txt)
objWord.Selection.GoTo -1,,, "Dato"
objWord.Selection.TypeText cStr(formatDateTime(Date, 1))
set objDoc = nothing
set objWord = nothing
end function
sub cmdBrevTilKandidat_click()
startDokument path & "Indkaldselsbrev.doc"
end sub
sub cmdMailTilKandidat_click()
startDokument path & "Indkaldselsmail.doc"
end sub
Any help would be appeciated.
Kind regards
Christian