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

or

Sut i ddod o hyd i ffolder (llwybr ffolder llawn) yn ôl enw'r ffolder yn Outlook?

Er enghraifft, ar y cwarel Llywio rydych chi'n symud ffolder ac yn ei ollwng i ffolder anhysbys trwy gamgymeriad yn Outlook, rydych chi am adfer y ffolder hon ond ni allwch ei ddarganfod ar unwaith. Yn anffodus, nid yw Camre yn cefnogi'r Dod o hyd i nodwedd yr un fath â'r un yn Microsoft Word neu Excel. Peidiwch â phoeni! Gallwch gymhwyso macro VBA i ddatrys y broblem hon yn Outlook.

Chwiliwch yn gyflym ac agor ffolderau yn ôl enw ffolder gydag offeryn anhygoel

Yn gyffredinol, gallwn chwilio ffolderau yn ôl enw ffolder gyda chod VBA. Gall y rhan fwyaf o god VBA chwilio ffolderau yn y blwch post cyfredol, ac agor y ffolder a ddarganfuwyd gyntaf yn unig. Nawr gyda'r nodwedd Go To o Kutools for Outlook, gallwch chi ddod o hyd i ffolderau yn ôl enw ffolder yn hawdd, ac agor unrhyw un o ffolderau a ganfuwyd yn ôl yr angen. Cliciwch am dreial 60 diwrnod am ddim heb gyfyngiad!


Dewch o hyd i ffolder (llwybr ffolder llawn) yn ôl enw'r ffolder gyda VBA

Dilynwch y camau isod i chwilio am ffolderau yn ôl enwau ffolderi gyda VBA yn Outlook.

1. Gwasgwch Alt + F11 allweddi gyda'i gilydd i agor ffenestr Microsoft Visual Basic for Applications.

2. Cliciwch Mewnosod > Modiwlau, ac yna pastiwch islaw cod VBA i mewn i ffenestr y Modiwl newydd.

VBA: Chwilio ac agor ffolderau yn ôl enw ffolder yn Outlook

Private m_Folder As MAPIFolder
Private m_Find As String
Private m_Wildcard As Boolean

Private Const SpeedUp As Boolean = True
Private Const StopAtFirstMatch As Boolean = True

Public Sub FindFolder()
Dim sName As String
Dim oFolders As Folders

  Set m_Folder = Nothing
m_Find = ""
m_Wildcard = False

  sName = InputBox("Find:", "Search folder")
If Len(Trim(sName)) = 0 Then Exit Sub
m_Find = sName

  m_Find = LCase(m_Find)
m_Find = Replace(m_Find, "%", "*")
m_Wildcard = (InStr(m_Find, "*"))

  Set oFolders = Application.Session.Folders
LoopFolders oFolders

  If Not m_Folder Is Nothing Then
If MsgBox("Activate folder: " & vbCrLf & m_Folder.FolderPath, vbQuestion Or vbYesNo) = vbYes Then
Set Application.ActiveExplorer.CurrentFolder = m_Folder
End If
Else
MsgBox "Not found", vbInformation
End If
End Sub

Private Sub LoopFolders(Folders As Outlook.Folders)
Dim oFolder As MAPIFolder
Dim bFound As Boolean

If SpeedUp = False Then DoEvents

  For Each oFolder In Folders
If m_Wildcard Then
bFound = (LCase(oFolder.Name) Like m_Find)
Else
bFound = (LCase(oFolder.Name) = m_Find)
End If

    If bFound Then
If StopAtFirstMatch = False Then
If MsgBox("Found: " & vbCrLf & oFolder.FolderPath & vbCrLf & vbCrLf & "Continue?", vbQuestion Or vbYesNo) = vbYes Then
bFound = False
End If
End If
End If
If bFound Then
Set m_Folder = oFolder
Exit For
Else
LoopFolders oFolder.Folders
If Not m_Folder Is Nothing Then Exit For
End If
Next
End Sub

3. Gwasgwch F5 allwedd neu cliciwch y Run botwm i redeg y VBA hwn.

4. Yn y blwch deialog ffolder Chwilio, teipiwch enw'r ffolder penodedig y byddwch chi'n chwilio amdano, a chliciwch ar y OK botwm. Gweler y screenshot:

Nodyn: Mae'r VBA hwn yn cefnogi cerdyn gwyllt seren. Er enghraifft, gallwch deipio tes * i ddarganfod yr holl ffolderau y mae eu henw yn dechrau tes.

5. Nawr mae blwch deialog yn dod allan ac yn dangos llwybr ffolder y ffolder a ddarganfuwyd. Os oes angen ichi agor y ffolder a ddarganfuwyd, cliciwch y Ydw botwm.

Ac yn awr mae'r ffolder a ddarganfuwyd yn agor ar y cwarel Llywio fel y dangosir isod y llun:

Nodyn: Os oes mwy nag un ffolder wedi'i enwi gyda'r enw penodedig, gall y VBA hwn ddod o hyd i un ffolder yn unig a'i agor.


Chwilio ffolder yn ôl enw ffolder gan offeryn anhygoel

Os oes gennych Kutools for Outlook wedi'i osod, gallwch gymhwyso ei nodwedd Go To i ddarganfod yr holl ffolderau yn gyflym gan enw ffolder penodol, ac agor unrhyw ffolderau y deuir o hyd iddynt hefyd yn hawdd.

Kutools ar gyfer Rhagolwg: Ychwanegwch fwy na 100 o offer defnyddiol ar gyfer Outlook, am ddim i geisio heb unrhyw gyfyngiad mewn 60 diwrnod. Darllenwch mwy      Treial Am Ddim Nawr

1. Cliciwch Kutools Plus > Ewch i i alluogi'r nodwedd hon.

2. Yn y dialog Ewch i, teipiwch enw'r ffolder penodedig yn y Chwilio blwch, dewiswch ffolder yn y canlyniadau chwilio, a chliciwch ar y Ok botwm.

Nawr mae'r ffolder penodedig sydd ag enw penodol y ffolder yn cael ei ddarganfod a'i agor ar unwaith.


Erthyglau cysylltiedig:


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.
    angasomangas@gmail.com · 8 months ago
    This macro has really helped me is incredible, thank you!!!

    Is it possible to to go to the next occurrence, so instead of just Yes/No have something as Yes/Next/No ?

    Thank you
    • To post as a guest, your comment is unpublished.
      GanKapil · 8 months ago
      Private m_Folder As MAPIFolder
      Private m_Find As String
      Private m_Wildcard As Boolean

      Private Const SpeedUp As Boolean = True
      'Private Const StopAtFirstMatch As Boolean = True
      Private StopAtFirstMatch As Boolean

      Public Sub FindFolder()
      Dim sName As String
      Dim oFolders As Folders

      Set m_Folder = Nothing
      m_Find = ""
      m_Wildcard = False

      sName = InputBox("Find:", "Search folder")
      If Len(Trim(sName)) = 0 Then Exit Sub

      'm_Find = sName
      ' Added "*"... for any given string in the folder name
      m_Find = "*" & sName & "*"

      m_Find = LCase(m_Find)
      m_Find = Replace(m_Find, "%", "*")
      m_Wildcard = (InStr(m_Find, "*"))

      ' Set oFolders = Application.Session.Folders
      Set oFolders = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders

      LoopFolders oFolders

      If Not m_Folder Is Nothing Then
      ' Removed - If MsgBox("Activate folder: " & vbCrLf & m_Folder.FolderPath, vbQuestion Or vbYesNo) = vbYes Then
      Set Application.ActiveExplorer.CurrentFolder = m_Folder
      Else
      MsgBox "Search End...", vbInformation
      End If
      End Sub

      Private Sub LoopFolders(Folders As Outlook.Folders)
      Dim oFolder As MAPIFolder
      Dim bFound As Boolean

      If SpeedUp = False Then DoEvents

      For Each oFolder In Folders
      If m_Wildcard Then
      bFound = (LCase(oFolder.Name) Like m_Find)
      Else
      bFound = (LCase(oFolder.Name) = m_Find)
      End If


      If bFound Then
      If StopAtFirstMatch = False Then
      Set Application.ActiveExplorer.CurrentFolder = oFolder

      If MsgBox("Found: " & vbCrLf & oFolder.FolderPath & vbCrLf & vbCrLf & "Search for next?", vbQuestion Or vbYesNo) = vbYes Then
      bFound = False
      End If
      Else
      MsgBox ("Not found")
      End If
      End If
      If bFound Then
      Set m_Folder = oFolder
      Exit For
      Else
      LoopFolders oFolder.Folders
      If Not m_Folder Is Nothing Then Exit For
      End If
      Next
      End Sub




      • To post as a guest, your comment is unpublished.
        Francesco · 10 days ago
        Hi, if i try to copy and past the macro yes/next/no, I only received the message "Search End".
        Could you take a look? I would really appreciate it. Thanks
      • To post as a guest, your comment is unpublished.
        Francesco · 10 days ago
        Hi, if i try to copy and past the macro yes/next/no, I only received the message "Search End".
        Could you take a look? I would really appreciate it. Thanks
      • To post as a guest, your comment is unpublished.
        angasomangas@gmail.com · 8 months ago
        Wow this is exactly. I really appreciate it and you did it so fast.Thanks
  • To post as a guest, your comment is unpublished.
    Gabe Btg · 1 years ago
    Hello,

    Thank you for this macro. It works great!


    Is there a way to make the macro always search as wildcards? I would be easier to just type a keyword without adding the asterisks every time.
    • To post as a guest, your comment is unpublished.
      GanKapil · 1 years ago

      Replace Line 18 with

      m_Find = "*" & sName & "*"
    • To post as a guest, your comment is unpublished.
      Gan Kapilavayi · 1 years ago
      Replace Line 18 with
      m_Find = "*" & sName & "*"
  • To post as a guest, your comment is unpublished.
    RapF · 1 years ago
    Hello.

    Wow - this is an amazing function, which will make my daily usage of Outlook tons faster.
    Thank you so much for publishing!!

    A tip for those interested:
    If you want to search only INBOX-folders, without public folders etc.
    This made it a lot faster for me because the public folder are remote, so the search is quite slow.
    And also I'm not interested in those results.


    Replace line 24 with:

    Set oFolders = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders