Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Outlook Macros (MSO2003/VB6)

    >>
    I can't answer your question about how to unlock it, but you shouldn't have these problems if you export your code to .VBA, .CLS and .FRM files, as applicable, rather than copying the OTM file, and reimport them to a fresh .OTM if your OTM goes bad.
    ****
    Within the VBE, select the Module and File | Import/Export, or right click the Module | Import/Export. Within the VBE, select the Project, only Import is available.
    <<

    When I tried to export a macro file in Outlook, I was only offered the option of "cls" (class) files. Where (what) are vba or frm files in this context?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook Macros (MSO2003/VB6)

    The file extension may be related to the type of module that contains the code. A class module will export with a .cls extension; a regular code module with a .bas extension; a form into two files with .frm and .frx extensions. ThisOutlookSession probably behaves like a class module.

    For maximum predictability in what is being exported, right-click the module/form in the Project Explorer pane and choose Export File... from the context menu.

  3. #3
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Jefferson:

    I had always thought of class modules as a java thing... the others make sense now that you point them out....

    I just did it "right-click" and still got just the cls option... by predictability, do you "the who project" as opposed to just part(s)?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Outlook Macros (MSO2003/VB6)

    You cannot export the whole project, only individual (class) modules and forms. By right-clicking a specific object and selecting Export File..., you know for certain what you are going to export. If you use the File menu, you'll export whatever happened to be selected, so you might export something different from what you intended if you don't watch closely.

  5. #5
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Hans:

    In this particular project, I have 3 macros...

    When I right-click on the project file and export it, all 3 macros went out...

    Is the limitation incoming when the file becomes more complex and multi-parts?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Macros, procedures, functions are stored in modules. You cannot export or import individual macros etc., only modules as a whole. (You can, of course copy and paste bits of code between modules and a text file)

  7. #7
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Hans:

    But, for instance, Outlook macros are stored in vbaproject.otm. If I right-click the project file and export it, aren't I exporting the entire file? So that I could then start a new project file, import the export, and have all components available?

    What would I be missing? Not the macros, because they show... Forms? What?

    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Outlook Macros (MSO2003/VB6)

    I am using Outlook 2002, not 2003. If I right-click the entire project, the Export File option in the popup menu is disabled (greyed out). The option is enabled if I right-click an individual module or form.

  9. #9
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Hans:

    Then that's good... Looks like I lucked out skipping 2002 and getting 2003...

    Thanks,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Macros (MSO2003/VB6)

    as habs stated, there is no export option unless you right click on an individual component of the project.
    this is so for outlook 2003 as well.

    of course, somebody may have installed an add-in on your system that modifies the built-in behavior, but i doubt it.

  11. #11
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Howard:

    I looked again...

    I apologize to you and Hans... It is not the entire project. It's the Outlook session that is able to be exported...

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Outlook Macros (MSO2003/VB6)

    As Jefferson remarked in the very first reply in this thread, ThisOutlookSession is a class module, and like all class modules, it can be exported. If you do so, you will export all procedures and functions in ThisOutlookSession, but you will not export code that is present in other modules, class modules and userforms; if you have any of those, you need to export them separately.

  13. #13
    Platinum Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    5,619
    Thanks
    53
    Thanked 9 Times in 8 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Hans:

    Yes, I guess I'm just familiar enough with VB... I need to work on it a bit. Thanks to you both.

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  14. #14
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Macros (MSO2003/VB6)

    There's no such thing as an "Outlook Session" in the VBA IDE.
    Export works only on project components, i.e., a userform, standard module, or class module.

  15. #15
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook Macros (MSO2003/VB6)

    Howard, he was referring to the equivalent of Word's ThisDocument module, which in Outlook is called ThisOutlookSession. I think the rest of the thread makes that clear.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •