VBA: Replace the Outlook "View in Browser" using any browser you wish

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 11

  • @ianjacobs3367
    @ianjacobs3367 3 года назад +3

    @JohnDayQA: I don't know VBA. I copied the code into my Outlook and it worked straight away without changing it.
    Should I be worried or lucky?

    • @JohnDayQA
      @JohnDayQA  3 года назад +2

      That's great news. In most cases very little code needs to be changed but everyone's windows environment is different, and it depends on whether you have the 32bit (Prgram Files (x86) or 64bit (Program Files) versions of browsers.

  • @Kiriakos.T_Greece
    @Kiriakos.T_Greece 12 дней назад

    It was a small adventure so to setup everything, but it worked with MS Office 14 (2010) + Win7 Pro 64bit Retail. Read as PDF, it’s pointless because at Microsoft Office 2010, MS-Word this still blocking images review. Opening at Firefox ESR this works nicely, from there you may print in PDF by the use of PDFCreator / eDoc Printer. Tried to disable the pop-up, and this killed the MACRO functionality. I did setup everything again by reinstalling the macro again. At first installation the MACRO worked right away, and then Outlook started to complain about security settings, I was forced to disable security. Best regards from Greece.

  • @daytamod8806
    @daytamod8806 3 года назад +1

    Does not work. The code crashes with run-time error - Operation failed.
    It crashed highlighting the line "objItem.SaveAs strMessagePath & strMessageFile & ".html", olHTML"

    • @JohnDayQA
      @JohnDayQA  3 года назад +2

      @DaytaMOD Your message has failed becasue the file name still has some illegal characters. If you open the immediate window from the view mene, and type debug.print strMessageFile, read the file name. If it contains question marks, commas, plus signs, then take one of the lines of code as mentioned in the videeo and paste it replacing the illegal character with one that is allowed.
      e.g. : strMessageFile = Replace(strMessageFile, "?", "")
      This will remove the question mark and not replace it with nothing.

    • @daytamod8806
      @daytamod8806 3 года назад

      @@JohnDayQA That Worked! I did not know you could remove illegal characters and replace it with nothing. That is superb.
      Thank you.

  • @minjookim7547
    @minjookim7547 3 года назад +2

    outlook view in browser pain in the rear issue?
    LOL....

  • @colindrew5931
    @colindrew5931 3 года назад +1

    Hi John. I copied the code but it does not run. I can add the macros but I cannot rename them. Any help would be cool.

    • @JohnDayQA
      @JohnDayQA  3 года назад +1

      Colin, your Outlook has diabled running of Macros or is set to run digitally signed Macros.
      1: Click the FIle Tab --> Options
      2: Click Trust Center on the left.
      3: Click Trust Center Settings button on right.
      4: Click Macro Settings on the left
      5: Select Notification for all Macros (recommended if you do not have a digital signature.

    • @colindrew5931
      @colindrew5931 3 года назад

      @@JohnDayQA Got it. Now works. Thank you.

  • @JohnDayQA
    @JohnDayQA  3 года назад

    TO EVERYONE:
    You may need to add a few Replace commands as not all illegal characters have been spotted. There are so many that can be used in the subject line that the code would have been 50 times longer.
    strMessageFile = Replace(strMessageFile, """", "'"): strMessageFile = Replace(strMessageFile, "@", "-")
    ' replaces a double-quote with a single-quote
    strMessageFile = Replace(strMessageFile, ".", ""): strMessageFile = Replace(strMessageFile, "?", "") ' replaces a full-stop or period with nothing (just removes it).
    Add your own as you encoutner them.