Skip to main content

Conas ríomhphost a shábháil mar chomhad pdf in Outlook?

Má tá tú ag obair le Microsoft Outlook 2010 agus 2007, gheobhaidh tú amach nach bhfuil aon chur isteach in Outlook chun an ríomhphost a athrú go formáid pdf. Ní mór duit an ríomhphost a thiontú go comhad pdf le roinnt breiseán gaolmhar nó le cód VBA. Leis an alt seo a leanas, sábhálfaidh tú r-phost go héasca mar chomhad pdf in Outlook.

Sábháil ríomhphost mar chomhad pdf in Outlook le cód VBA

Sábhálann Bulk ríomhphoist iolracha mar chomhad pdf nó i bhformáidí comhaid eile le Bulk Savesmaoineamh maith3


Sábháil ríomhphost mar chomhad pdf in Outlook le cód VBA

1. Ar dtús ba cheart duit an ríomhphost a theastaíonn uait a shábháil mar PDF a roghnú.

2. Brúigh Alt + F11 chun an Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

3. cliceáil Ionsáigh > Modúil, ansin cóipeáil agus greamaigh an cód VBA seo a leanas chuig fuinneog an Mhodúil.

Cód VBA maidir le ríomhphost a shábháil mar chomhad 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

nótaí: Rinneadh tástáil rathúil ar an gcód VBA seo in Outlook 2007 agus 2010

4. cliceáil chun an cód a rith.

5. Beidh a Sábháil Comhad dialóg popping suas agus an cód ag rith. Roghnaigh cosán chun an comhad a shábháil, ainmnigh é, agus cliceáil ar deireadh Sábháil cnaipe.

6. Nuair a chríochnaíonn an cód ag rith, athraíodh an ríomhphost go comhad pdf go rathúil.


Sábhálann Bulk ríomhphoist iolracha mar chomhad pdf nó i bhformáidí comhaid eile le Bulk Save

Le Kutools for Outlook suiteáilte, is féidir leat a Bulk Save fóntais chun na ríomhphoist roghnaithe a shábháil nó a easpórtáil go tapa chuig comhaid PDF / comhaid Excel / comhaid CSV nó formáidí comhaid eile.

Kutools for Outlook, Áirítear gnéithe agus uirlisí cumhachtacha do Microsoft Outlook 2019, 2016, 2013, 2010 agus Office 365.

1. I bhfillteán ríomhphoist, roghnaigh na teachtaireachtaí a theastaíonn uait a shábháil mar PDF, cliceáil Kutools > Bulk Save.
mórchóir doc kutools ach 1

2. Sa Bulk Save dialóg, roghnaigh cosán chun na comhaid nua a chur, seiceáil PDF format, agus is féidir leat an Save content de réir mar is gá duit.
doc ach ríomhphost a shábháil mar pdf 4

3. cliceáil Ok. Ansin sábháladh na ríomhphoist roghnaithe mar chomhaid PDF ina n-aonar.
doc ach ríomhphost a shábháil mar pdf 5


Uirlisí Táirgiúlachta Oifige is Fearr

Kutools le haghaidh Outlook - Níos mó ná 100 Gnéithe cumhachtacha chun do Outlook a shárú

🤖 Cúntóir Ríomhphoist AI: Ríomhphoist pro toirt le draíocht AI - aon-cliceáil chun freagraí genius, ton foirfe, máistreacht ilteangach. Trasfhoirmigh ríomhphost gan stró! ...

📧 Uathoibriú Ríomhphoist: As Oifig (Ar fáil do POP agus IMAP)  /  Sceideal Seol Ríomhphoist  /  Auto CC/BCC de réir Rialacha Agus Ríomhphost á Sheoladh  /  Auto Ar Aghaidh (Ardrialacha)   /  Beannacht Auto Cuir leis   /  Scoilt Ríomhphoist Ilfhaighteoirí go huathoibríoch i dTeachtaireachtaí Aonair ...

📨 Bainistíocht Ríomhphost: Ríomhphoist a Athghairm go héasca  /  Bloc Ríomhphoist Scam ag Ábhair agus Daoine Eile  /  Scrios Ríomhphoist Dúblacha  /  Cuardach Casta  /  Comhdhlúthaigh Fillteáin ...

📁 Ceangaltáin ProSábháil Baisc  /  Baisc Dícheangail  /  Comhbhrú Baisc  /  Auto Sábháil   /  Auto Dícheangail  /  Comhbhrúite Auto ...

🌟 Draíocht Chomhéadain: 😊Níos mó Emojis Pretty and Cool   /  Treisiú Do Tháirgiúlacht Outlook le Radhairc Tabbed  /  Íoslaghdaigh Outlook In ionad Deiridh ...

???? Wonders aon-cliceáil: Freagair Gach Duine le Ceangaltáin Isteach  /   Ríomhphoist Frith-Iascaireachta  /  🕘 Taispeáin Crios Ama an tSeoltóra ...

👩🏼‍🤝‍👩🏻 Teagmhálaithe & Féilire: Baisc Cuir Teagmhálacha Ó Ríomhphoist Roghnaithe  /  Roinn Grúpa Teagmhála ar Ghrúpaí Aonair  /  Bain Meabhrúcháin Breithlá ...

Thar Gnéithe 100 Fan le do Thaiscéalaíocht! Cliceáil Anseo le Tuilleadh Amach.

 

 

Comments (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
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

This comment was minimized by the moderator on the site
Hi !!
I have follow all the instructions but it doesn't work, " Compile error : Syntax error"
Can you help me ? Please
Amaury
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
Been wondering how to do this for years, very easy, thank you
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
Super, worked like a charm. Thank you very much
This comment was minimized by the moderator on the site
Many thanks, friend. This was a great help.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations