Note: The other languages of the website are Google-translated. Back to English
Mewngofnodi  \/ 
x
or
x
Cofrestru  \/ 
x

or

Sut i arbed e-bost fel ffeil pdf yn Outlook?

Os ydych chi'n gweithio gyda Microsoft Outlook 2010 a 2007, fe welwch nad oes unrhyw gynnwys yn Outlook i newid yr e-bost i fformat pdf. Mae angen i chi drosi'r e-bost yn ffeil pdf gan rai ychwanegiadau cysylltiedig neu gyda chod VBA. Gyda'r erthygl ganlynol, byddwch yn hawdd arbed e-bost fel ffeil pdf yn Outlook.

Cadwch e-bost fel ffeil pdf yn Outlook gyda chod VBA

Swmp arbed sawl e-bost fel ffeil pdf neu fformatau ffeil eraill gyda Bulk Savesyniad da3


Cadwch e-bost fel ffeil pdf yn Outlook gyda chod VBA

1. Yn gyntaf, dylech ddewis yr e-bost yr ydych am ei gadw fel PDF.

2. Gwasgwch Alt + F11 i lansio'r Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

3. Cliciwch Mewnosod > Modiwlau, yna copïwch a gludwch y cod VBA canlynol i ffenestr y Modiwl.

Cod e-bost arbed VBA fel ffeil PDF:

Sub SaveAsPDFfile()
Dim MyOlNamespace As NameSpace
Dim MySelectedItem As MailItem
Dim Response As String
Dim FSO As Object, TmpFolder As Object
Dim tmpFileName As String
Dim wrdApp As Object
Dim wrdDoc As Object
Dim bStarted As Boolean
Dim dlgSaveAs As FileDialog
Dim fdfs As FileDialogFilters
Dim fdf As FileDialogFilter
Dim i As Integer
Dim WshShell As Object
Dim SpecialPath As String
Dim msgFileName As String
Dim strCurrentFile As String
Dim strName As String
Dim oRegEx As Object
Dim intPos As Long
Set MyOlNamespace = Application.GetNamespace("MAPI")
Set MySelectedItem = ActiveExplorer.Selection.Item(1)
Set FSO = CreateObject("Scripting.FileSystemObject")
tmpFileName = FSO.GetSpecialFolder(2)
strName = "email_temp.mht"
tmpFileName = tmpFileName & "\" & strName
MySelectedItem.SaveAs tmpFileName, 10
On Error Resume Next
Set wrdApp = GetObject(, "Word.Application")
If Err Then
Set wrdApp = CreateObject("Word.Application")
bStarted = True
End If
On Error GoTo 0
Set wrdDoc = wrdApp.Documents.Open(FileName:=tmpFileName, Visible:=False, Format:=7)
Set dlgSaveAs = wrdApp.FileDialog(msoFileDialogSaveAs)
Set fdfs = dlgSaveAs.Filters
i = 0
For Each fdf In fdfs
i = i + 1
If InStr(1, fdf.Extensions, "pdf", vbTextCompare) > 0 Then
Exit For
End If
Next fdf
dlgSaveAs.FilterIndex = i
Set WshShell = CreateObject("WScript.Shell")
SpecialPath = WshShell.SpecialFolders(16)
msgFileName = MySelectedItem.Subject
Set oRegEx = CreateObject("vbscript.regexp")
oRegEx.Global = True
oRegEx.Pattern = "[\/:*?""<>|]"
msgFileName = Trim(oRegEx.Replace(msgFileName, ""))
dlgSaveAs.InitialFileName = SpecialPath & "\" & msgFileName
If dlgSaveAs.Show = -1 Then
strCurrentFile = dlgSaveAs.SelectedItems(1)
If Right(strCurrentFile, 4) <> ".pdf" Then
Response = MsgBox("Sorry, only saving in the pdf-format is supported." & _
vbNewLine & vbNewLine & "Save as pdf instead?", vbInformation + vbOKCancel)
If Response = vbCancel Then
wrdDoc.Close 0
If bStarted Then wrdApp.Quit
Exit Sub
ElseIf Response = vbOK Then
intPos = InStrRev(strCurrentFile, ".")
If intPos > 0 Then
strCurrentFile = Left(strCurrentFile, intPos - 1)
End If
strCurrentFile = strCurrentFile & ".pdf"
End If
End If
wrdApp.ActiveDocument.ExportAsFixedFormat OutputFileName:= _
strCurrentFile, _
ExportFormat:=17, _
OpenAfterExport:=False, _
OptimizeFor:=0, _
Range:=0, _
From:=0, _
To:=0, _
Item:=0, _
IncludeDocProps:=True, _
KeepIRM:=True, _
CreateBookmarks:=0, _
DocStructureTags:=True, _
BitmapMissingFonts:=True, _
UseISO19005_1:=False
End If
Set dlgSaveAs = Nothing
wrdDoc.Close
If bStarted Then wrdApp.Quit
Set MyOlNamespace = Nothing
Set MySelectedItem = Nothing
Set wrdDoc = Nothing
Set wrdApp = Nothing
Set oRegEx = Nothing
End Sub

Nodyn: Mae'r cod VBA hwn wedi profi'n llwyddiannus yn Outlook 2007 a 2010

4. Cliciwch i redeg y cod.

5. Bydd a Cadw Ffeil deialog yn popio i fyny tra bod y cod yn rhedeg. Dewiswch lwybr i achub y ffeil, ei henwi, ac yn olaf cliciwch ar Save botwm.

6. Pan fydd y cod yn gorffen rhedeg, mae'r e-bost wedi trosi'n ffeil pdf yn llwyddiannus.


Swmp arbed sawl e-bost fel ffeil pdf neu fformatau ffeil eraill gyda Bulk Save

gyda Kutools for Outlook wedi'i osod, gallwch ddefnyddio ei Bulk Save cyfleustodau i arbed neu allforio'r e-byst a ddewiswyd yn gyflym i ffeiliau PDF / ffeiliau Excel / ffeiliau CSV neu fformatau ffeiliau eraill.

Kutools for Outlook, yn cynnwys 100 nodweddion ac offer pwerus ar gyfer Microsoft Outlook 2019, 2016, 2013, 2010 ac Office 365.

1. Mewn ffolder e-bost, dewiswch y negeseuon rydych chi am eu cadw fel PDF, cliciwch Kutools > Bulk Save.
swmp doc kutools arbed 1

2. Yn y Bulk Save deialog, dewiswch lwybr i osod y ffeiliau newydd, gwirio PDF format, a gallwch chi nodi'r Save content fel y mae arnoch ei angen.
doc arbed e-bost fel pdf 4

3. Cliciwch Ok. Yna mae'r e-byst a ddewiswyd wedi'u cadw fel ffeiliau PDF yn unigol.
doc arbed e-bost fel pdf 5


Kutools for Outlook - Yn Dod â 100 o Nodweddion Uwch i'w Rhagweld, a Gwneud Gwaith yn Haws Osgach!

  • Auto CC / BCC yn ôl rheolau wrth anfon e-bost; Auto Ymlaen E-byst Lluosog yn ôl arfer; Ymateb Auto heb weinydd cyfnewid, a nodweddion mwy awtomatig ...
  • Rhybudd BCC - dangoswch neges pan geisiwch ateb popeth os yw'ch cyfeiriad post yn rhestr BCC; Atgoffwch Wrth Ymlyniadau ar Goll, a mwy o nodweddion atgoffa ...
  • Ymateb (Pawb) Gyda'r Holl Atodiadau yn y sgwrs bost; Ateb Llawer o E-byst mewn eiliadau; Auto Ychwanegu Cyfarchiad wrth ateb; Ychwanegu Dyddiad i'r pwnc ...
  • Offer Ymlyniad: Rheoli Pob Atodiad ym mhob Post, Datgysylltiad Auto, Cywasgu Pawb, Ail-enwi Pawb, Arbed Pawb ... Adroddiad Cyflym, Cyfrif Postiau Dethol...
  • E-byst Sothach Pwerus yn ôl arfer; Tynnwch y Post a Chysylltiadau Dyblyg... Yn eich galluogi i wneud yn ddoethach, yn gyflymach ac yn well yn Outlook.
tab kutools rhagweld kutools tab 1180x121
kutools rhagweld rhagolygon kutools ynghyd â thab 1180x121
 
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    marco · 6 months ago
    or (but for this you need to open the mail) you could use this:

    ActiveInspector.WordEditor.ExportAsFixedFormat "c:\temp\test.pdf",ExportFormat:=17, OpenAfterExport:=False, OptimizeFor:=0, Range:=0, From:=0, To:=0, Item:=0, IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:=0, DocStructureTags:=True, BitmapMissingFonts:=True, UseISO19005_1:=False

  • To post as a guest, your comment is unpublished.
    Amaury · 3 years ago
    Hi !!
    I have follow all the instructions but it doesn't work, " Compile error : Syntax error"
    Can you help me ? Please
    Amaury
  • To post as a guest, your comment is unpublished.
    soni.shashank22@gmail.com · 3 years ago
    This macro is really great and easy to use as well,thank you so much for sharing this.
    Just wanted to check is it possible to create same kind of macro for PDF attachment as well,because the above macro works only for excel and word format.

    Can any one one help me on this.
  • To post as a guest, your comment is unpublished.
    mac · 4 years ago
    I am wondering how I could change the folder the pdf goes to and change the filename(since all the emails I am copying are called the same thing
  • To post as a guest, your comment is unpublished.
    Kade · 4 years ago
    Been wondering how to do this for years, very easy, thank you
  • To post as a guest, your comment is unpublished.
    Mar · 5 years ago
    Hi All,

    PDF is saving in default size and I can't see all text, tables, etc. from email. How can I fix that? Is it any way to save email as PDF file in responsive size?
  • To post as a guest, your comment is unpublished.
    EM · 5 years ago
    The VBA code works perfectly! Now, is there any way to adjust this in order to default "save as" to be .msg in Outlook 2007?
  • To post as a guest, your comment is unpublished.
    ryan · 5 years ago
    I have been able to use this. But now when I run it is just saving a copy of this page. I get a PDF of the instructions rather than the email I was trying to convert. Any suggestions?
  • To post as a guest, your comment is unpublished.
    Hemanth · 5 years ago
    Super, worked like a charm. Thank you very much
  • To post as a guest, your comment is unpublished.
    Calvin · 7 years ago
    Many thanks, friend. This was a great help.
  • To post as a guest, your comment is unpublished.
    JG · 7 years ago
    Excellent, thank you!