Outlook ошибка сценария незавершенная строковая константа

Every time I open an email from someone in Outlook 2010, I am getting an error:
  • Remove From My Forums
  • Вопрос

  • Every time I open an email from someone in Outlook 2010, I am getting an error:

    An error has occurred in the script on this page.

    Line: 357

    Char: 125

    Error: Unterminated string constant

    Code: 0

    URL:
    file:///C:/Users/****/AppData/Local/Microsoft/Windows/Temporary%20internet%20Files/{GUID}

    Do you want to continue running scripts on this page?

    I am running this on Windows 7 Professional 32-bit.

    Only 1 machine affected at the moment.

    What is the solution?

    Regards,

    QuietLeni

    • Изменен тип

      14 февраля 2011 г. 4:19

Ответы

  • I found that deleting the profle or OST under the user folder (%system%User%User%AppDataLocalMicrosoftOutlook) worked.

    • Помечено в качестве ответа
      Sally Tang
      14 февраля 2011 г. 4:19

  • Remove From My Forums
  • Question

  • I have a user who when launches Outlook help in office 2013, it brings up window after window of script errors.

    The PC and user are within a 2008 windows server domain environment.

    This only occurs for the 1 user on office 2013. Domain admin and other users can log on to the same laptop and access the help function fine.

    I have created new windows profiles after clearing down the reg keys for this one user and the same script errors occur.

    Originally installed as a scripted install from Dell Kace, but have installed office 13 from Disc and still the same error occurs ( Originally ran office repair, no difference).

    This works fine in 2007 and 2010 outlook. Any ideas would be great.

    Thanks.

  • Remove From My Forums
  • Question

  • I have a user who when launches Outlook help in office 2013, it brings up window after window of script errors.

    The PC and user are within a 2008 windows server domain environment.

    This only occurs for the 1 user on office 2013. Domain admin and other users can log on to the same laptop and access the help function fine.

    I have created new windows profiles after clearing down the reg keys for this one user and the same script errors occur.

    Originally installed as a scripted install from Dell Kace, but have installed office 13 from Disc and still the same error occurs ( Originally ran office repair, no difference).

    This works fine in 2007 and 2010 outlook. Any ideas would be great.

    Thanks.

Я взял этот сценарий с веб-сайта. Я пытаюсь добавить ярлыки на панель задач и в меню «Пуск» в Windows 8. Мои знания VBScript довольно слабы. Я почти уверен, что где-то мне просто не хватает «, но я не совсем уверен, где. Первая строка» после Else WScript.Echo не отображается синим цветом в моем текстовом редакторе, как должно быть, поэтому может быть что-то там тоже. Любая помощь будет принята с благодарностью (ошибка утверждается, что находится на 5, 60)

'Pin an application to a start menu or task bar
If WScript.Arguments.Count = 3 then
Call PinApplicationToTaskBar(WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2))
Else
WScript.Echo "Missing parameters. String AppPathAndName  _
String ShortcutName Boolean OnStartMenu." & vbCr & vbCr & "  _
Example cmd.exe CMD  false" & vbCr & vbCr & _
"  Example %windir%system32SnippingTool.exe SnipIt false" 
End If

Public Sub PinApplicationToTaskBar(AppPathAndName, ShortcutName, OnStartMenu)
'This is on for a soft failure. 
'Uncomment this if error checking for a hard failure is needed for debugging.
On Error Resume Next

Dim FileSystemObj, ObjShell, ObjShellApp
Set ObjShell = WScript.CreateObject("WScript.Shell")
Set FileSystemObj = CreateObject("Scripting.FileSystemObject")

'Create a temp location for the short-cut to exist
TempShortcutLocation = FileSystemObj.GetFolder_
(ObjShell.ExpandEnvironmentStrings("%TEMP%"))
'Where is it being pinned too?  Determine the location where the pinned item will reside.
If(trim(lcase(OnStartMenu)) = "true") then ' pinned to start menu
    HasItAlreadyBeenPinnedShortCut = ObjShell.ExpandEnvironmentStrings_
    ("%APPDATA%") & _
    "MicrosoftInternet ExplorerQuick LaunchUser PinnedStartMenu"
Else
    HasItAlreadyBeenPinnedShortCut = ObjShell.ExpandEnvironmentStrings_
    ("%APPDATA%") & _
    "MicrosoftInternet ExplorerQuick LaunchUser PinnedTaskBar"
End If
'Temporary location for the application short-cut
TempShortcut = TempShortcutLocation & "" & ShortcutName & ".lnk"
'Possible location of a pinned item
HasItAlreadyBeenPinnedShortCut =  HasItAlreadyBeenPinnedShortCut & "" & ShortcutName & ".lnk"
'If this already exists, than exit this procedure. The application has already been pinned.
If(FileSystemObj.FileExists(HasItAlreadyBeenPinnedShortCut)) Then
    'MsgBox(HasItAlreadyBeenPinnedShortCut & " Already Pinned")
    Set ObjShell = Nothing
    Set FileSystemObj = Nothing
    Exit Sub
End If
'Create a short-cut using the shell
Set lnk = ObjShell.CreateShortcut(TempShortcut)
lnk.TargetPath = AppPathAndName ' Full application path and name
lnk.Arguments = ""
lnk.Description = ShortcutName 'The name that appears on the start menu.
lnk.Save 

Set ObjShellApp = CreateObject("Shell.Application")

'Get the newly created short-cut full path
Set ShortCutToPin =  ObjShellApp.NameSpace(TempShortcutLocation) 

If(FileSystemObj.FileExists(TempShortcut)) Then 
    Dim ShortCutToPinItem, verb
    'Set the location to pin the item to do based on the passed OnStartMenu argument
    If(trim(lcase(OnStartMenu)) = "true") then
        verbToDo = "Pin to Start Men&u"
    Else    
        verbToDo = "Pin to Tas&kbar"
    End If
    For Each ShortCutToPinItem in ShortCutToPin.Items()
        'Look for the pinning verb when the temporary short-cut name matches the passed ShortcutName argument
        If (ShortCutToPinItem.Name = ShortcutName) Then
            'Loop through the shell object's (the short-cut) commands looking for the pinning method.
            For Each verb in ShortCutToPinItem.Verbs 
                'The verb matches the verbToDo so pin it to verb's defined location
                If (verb.Name = verbToDo) Then verb.DoIt
            Next
        End If
    Next
    'Delete the temporary short-cut used to pin the application
    FileSystemObj.DeleteFile(TempShortcut) 
End If
'clean up
Set ObjShell =  Nothing
Set FileSystemObj = Nothing
Set ObjShellApp = Nothing
End Sub

Для справки и чести, код пришел отсюда. http: //www.codeproject .com / Tips / 713824 / Закрепить-ярлык-на-панели-задач-или-меню

1 ответ

Лучший ответ

Эта конкатенация строк испорчена. Должно получиться так:

WScript.Echo "Missing parameters. String AppPathAndName " & _
             "String ShortcutName Boolean OnStartMenu." & vbCr & vbCr & _
             "Example cmd.exe CMD false" & vbCr & vbCr & _
             "Example %windir%system32SnippingTool.exe SnipIt false" 

Вы должны использовать операторы продолжения строки (_) и конкатенации строк (&) для объединения строк в несколько строк в VBScript. Убедитесь, что все строковые литералы закрыты (каждая кавычка имеет соответствующую закрывающую кавычку в той же строке).


2

Bond
8 Апр 2014 в 06:02

Понравилась статья? Поделить с друзьями:
  • Oktoberfest история праздника
  • Oktell сценарий обработки контента
  • Oktell отладка сценариев
  • Nyx день рождения праздник
  • Novel ai сценарии