Skip i'r prif gynnwys

Sut i ychwanegu gwahanol lofnodion at gyfrifon e-bost lluosog wrth greu e-bost newydd yn Outlook?

O'r tiwtorial: Llofnodion E-bost Yn Outlook, dylech wybod sut i greu llofnod yn Outlook. Fodd bynnag, ar ôl creu llofnod newydd, bydd yn rhaid i chi ychwanegu'r llofnod a grëwyd at neges newydd â llaw trwy ddewis Llofnod > Y llofnod a grëwyd yn y ffenestr neges.

Wrth gwrs gallwch chi gael Outlook i ychwanegu llofnod yn awtomatig pan fyddwch chi'n creu neges newydd trwy glicio Llofnod > Llofnodion, a dewis llofnod ar gyfer cyfrif e-bost penodol fel y dangosir isod.

Fodd bynnag, beth os oes gennych lawer o gyfrifon e-bost ac eisiau ychwanegu gwahanol lofnodion ar gyfer eich cyfrifon lluosog mewn sypiau? Yn y tiwtorial hwn, byddaf yn cyflwyno dull VBA i'ch helpu i wneud y swydd hon yn hawdd.


Ychwanegu gwahanol lofnodion at gyfrifon e-bost lluosog wrth greu e-bost newydd yn Outlook

1. Yn eich Outlook, pwyswch y Alt + F11 allweddi i agor ffenestr Microsoft Visual Basic for Applications.

2. Yn y ffenestr Microsoft Visual Basic for Applications, cliciwch ddwywaith ar SesiwnOutlook yn y cwarel Prosiect, a chopïwch y cod VBA isod i ffenestr ThisOutlookSession (Cod). Gweler y sgrinlun:

Cod VBA: Ychwanegu gwahanol lofnodion i gyfrifon e-bost lluosog wrth greu e-bost newydd yn Outlook - ThisOutlookSession

Public WithEvents GInspectors As Inspectors
Public WithEvents GExplorer As Explorer

Private Sub Application_Startup()
  Set GInspectors = Application.Inspectors
  Set GExplorer = Application.ActiveExplorer
End Sub

Private Sub GExplorer_InlineResponse(ByVal Item As Object)
‘Update by ExtendOffice
Dim xMail As MailItem
On Error Resume Next
EndTimer
If Item.Class = olMail Then
  Set xMail = Item
  Set GInspector = Nothing
  Set GInspector = xMail.GetInspector
  StartTimer
End If
End Sub

Private Sub GInspectors_NewInspector(ByVal Inspector As Inspector)
  On Error Resume Next
  EndTimer
  Set GInspector = Nothing
  Set GInspector = Inspector
  StartTimer
End Sub

3. Yn ffenestr Microsoft Visual Basic for Applications, cliciwch Mewnosod > Modiwlau. Yna copïwch y cod VBA canlynol i ffenestr y Modiwl.

Cod VBA: Ychwanegu gwahanol lofnodion i gyfrifon e-bost lluosog wrth greu e-bost newydd yn Outlook - Modiwl

Public Declare PtrSafe Function SetTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As Long
Public Declare PtrSafe Function KillTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public GInspector As Inspector

Sub StartTimer()
  On Error Resume Next
  TimerID = SetTimer(0&, 0&, 1000&, AddressOf TimerProc)
End Sub

Sub EndTimer()
  On Error Resume Next
  KillTimer 0&, TimerID
End Sub

Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, ByVal nIDEvent As Long, ByVal dwTimer As Long)
  On Error Resume Next
  Call SetSignatureToAccount
  EndTimer
End Sub

Sub SetSignatureToAccount()
‘Update by ExtendOffice
Dim xMail As MailItem
Dim xSignatureFile, xSignaturePath As String
Dim xSubject As String
Dim xDoc As Document
Dim xAccount As Account
Dim xIsNew As Boolean
Dim xInspector As Inspector
Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
On Error Resume Next
xSignaturePath = CreateObject("WScript.Shell").SpecialFolders(5) + "\Microsoft\Signatures\"
xSubject = GInspector.Caption
Set xDoc = GInspector.WordEditor
xIsNew = False
Set xMail = GInspector.CurrentItem
Select Case xMail.Parent.Parent
  Case "" 'Replace the email address in double quotes
    If VBA.InStr(xSubject, "RE: ") = 1 Then
      Exit Sub
    ElseIf VBA.InStr(xSubject, "FW: ") = 1 Then
      Exit Sub
    Else
      xSignatureFile = xSignaturePath & "Signature1.htm" 'Replace "Signature1" with your actual signature name
      xIsNew = True
    End If
  Case "" 'Replace the email address in double quotes
    If VBA.InStr(xSubject, "RE: ") Then
      Exit Sub
    ElseIf VBA.InStr(xSubject, "FW: ") Then
      Exit Sub
    Else
      xSignatureFile = xSignaturePath & "Signature2.htm" 'Replace "Signature2" with your actual signature name
      xIsNew = True
    End If
  'Add more Cases for more email accounts
End Select
If xIsNew = True Then
  With xDoc.Application.Selection
    .WholeStory
    .EndKey
    .InsertParagraphAfter
    .MoveDown Unit:=wdLine, Count:=1
    .InsertFile FileName:=xSignatureFile, Link:=False, Attachment:=False
  End With
Else
  With xDoc.Application.Selection
    .MoveRight Unit:=wdCharacter, Count:=1
    .HomeKey Emptyparam, Emptyparam
    .InsertFile FileName:=xSignatureFile, Link:=False, Attachment:=False
  End With
End If
Set xDoc = Nothing
Set GInspector = Nothing
Set xMail = Nothing
End Sub
Nodyn:
  • 1) Dylech ddisodli'r ac yn y 39ain a'r 48ain rhesi i'ch cyfeiriadau e-bost go iawn.
  • 2) Dylech ddisodli Llofnod1 ac Llofnod2 yn y 45ain a'r 54ain rhesi i'ch enwau llofnod gwirioneddol.
  • 3) Gyda'r cod VBA uchod, gallwn ychwanegu llofnodion at ddau gyfrif e-bost. Os oes gennych chi fwy o gyfrifon, disodli 57fed rhes y cod gyda mwy o Achosion:
  • Achos""
    Os yw VBA.InStr(xSubject, "RE:") = 1 Yna
    Is Allanfa
    ElseIf VBA.InStr(xSubject, "FW:") = 1 Yna
    Is Allanfa
    arall
    xSignatureFile = xSignaturePath & "Signature.htm"
    xIsNew = Gwir
    Gorffennwch Os

4. Yn ffenestr Microsoft Visual Basic for Applications, cliciwch offer > Cyfeiriadau, gwiriwch y blwch nesaf at Llyfrgell Gwrthrychau Microsoft Word 16.0, a chliciwch OK.

5. Ailgychwyn Outlook, ac arbed y codau VBA.

6. Nawr, pan fyddwch chi'n creu neges newydd gyda chyfrif e-bost rydych chi wedi sefydlu llofnod ar ei gyfer, bydd y llofnod cyfatebol yn cael ei ychwanegu'n awtomatig.

Nodyn: Os gwelwch fod dau lofnod wedi'u hychwanegu pan fyddwch yn creu neges newydd gyda chyfrif e-bost, cliciwch Llofnod > Llofnodion yn y ffenestr neges. Yn yr adran Dewis llofnod rhagosodedig, dewiswch y cyfrif e-bost sydd â dau lofnod, a dewiswch (Dim) o'r gwymplen Negeseuon Newydd.


Erthyglau perthnasol

Sut i Fewnforio Neu Mewnosod Llofnodion HTML Yn Outlook?

Er enghraifft, gwnaethoch lawrlwytho rhai llofnodion HTML o wefannau, ac eisiau eu mewnforio i'ch Outlook. Unrhyw ffyrdd hawdd? Bydd yr erthygl hon yn eich tywys i fewnforio neu fewnosod llofnodion HTML yn Outlook gam wrth gam.

Sut i Mewnosod Lliw Cefndir Mewn Llofnod Outlook?

Mae'n hawdd ychwanegu neu ddileu lliw cefndir mewn e-bost yn Outlook. Ond, sut allech chi fewnosod neu ddileu lliw cefndir mewn llofnod Outlook? Bydd atebion isod yn eich helpu i'w ddatrys:

Sut i Ychwanegu Llofnodion Gwahanol I Gyfrifon E-bost Lluosog Wrth Ymateb Neu Anfon Ymlaen Yn Outlook?

Os ydych chi am i Outlook ychwanegu llofnod yn awtomatig pan fyddwch chi'n ateb neu'n anfon neges ymlaen, bydd angen i chi ffurfweddu'r llofnod rhagosodedig trwy glicio Llofnod > Llofnodion, a dewis llofnod ar gyfer cyfrif e-bost penodol fel y dangosir isod. Fodd bynnag, beth os oes gennych lawer o gyfrifon e-bost ac eisiau ychwanegu gwahanol lofnodion ar gyfer eich cyfrifon lluosog mewn sypiau? Yn y tiwtorial hwn, byddaf yn cyflwyno dull VBA i'ch helpu i wneud y swydd hon yn hawdd.

Sut i Osod Llofnod Gwahanol Ar Gyfer Ymatebion Ac Ymlaen Yn Outlook?

Fel rheol, gallwch chi osod gwahanol lofnodion ar gyfer gwahanol gyfrifon yn eich Camre, ond, erioed wedi ceisio cymhwyso gwahanol lofnodion ar gyfer atebion ac ymlaen. Mae'n golygu, pan fyddwch chi'n ateb e-bost, bod y llofnod1 wedi'i fewnosod, pan fyddwch chi'n anfon e-bost ymlaen mae'r llofnod2 yn cael ei gymhwyso. Sut allech chi ddatrys y dasg hon yn Outlook?


Offer Cynhyrchiant Swyddfa Gorau

Kutools ar gyfer Rhagolwg - Dros 100 o Nodweddion Pwerus i Werthu Eich Outlook

🤖 Cynorthwy-ydd Post AI: E-byst pro ar unwaith gyda hud AI - un clic i atebion athrylith, tôn berffaith, meistrolaeth amlieithog. Trawsnewid e-bostio yn ddiymdrech! ...

📧 E-bostio Automation: Allan o'r Swyddfa (Ar gael ar gyfer POP ac IMAP)  /  Amserlen Anfon E-byst  /  Auto CC/BCC gan Reolau Wrth Anfon E-bost  /  Awto Ymlaen (Rheolau Uwch)   /  Auto Ychwanegu Cyfarchiad   /  Rhannwch E-byst Aml-Dderbynnydd yn Negeseuon Unigol yn Awtomatig ...

📨 Rheoli E-bost: Dwyn i gof E-byst yn Hawdd  /  Rhwystro E-byst Sgam gan Bynciau ac Eraill  /  Dileu E-byst Dyblyg  /  Chwilio Manwl  /  Cydgrynhoi Ffolderi ...

📁 Ymlyniadau ProArbed Swp  /  Swp Datgysylltu  /  Cywasgu Swp  /  Auto Achub   /  Datgysylltiad Auto  /  Cywasgiad Auto ...

🌟 Rhyngwyneb Hud: 😊Mwy o Emojis Pretty a Cŵl   /  Rhowch hwb i'ch Cynhyrchiant Outlook gyda Golygfeydd Tabbed  /  Lleihau Outlook Yn lle Cau ...

???? Rhyfeddodau un clic: Ateb Pawb ag Ymlyniadau Dod i Mewn  /   E-byst Gwrth-Gwe-rwydo  /  🕘Dangos Parth Amser yr Anfonwr ...

👩🏼‍🤝‍👩🏻 Cysylltiadau a Chalendr: Swp Ychwanegu Cysylltiadau O E-byst Dethol  /  Rhannwch Grŵp Cyswllt i Grwpiau Unigol  /  Dileu Atgoffa Pen-blwydd ...

Dros Nodweddion 100 Aros Eich Archwiliad! Cliciwch Yma i Ddarganfod Mwy.

 

 

Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi,
I tried to initiate this settings in my outlook for changing the signature automatically, but it doesn't function.

the signature stays the same while using different email accounts.

any idea why ?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations