Visual Basic Macro in Outlook help
-
Outlook will save a montly calandar out as an html file, but I have to remember to do it each morning. I need to be able to automate this, so I guess I have to write a macro huh? The problem is, Outlook doesn't let me record macros so I'm kind of stuck (and hoping for a guru among the wtfers)
I went to Word and recorded a macro to save a document as a webpage and this is part of what I got:
ActiveDocument.SaveAs FileName:="Doc3.htm", FileFormat:=wdFormatHTML, _
So I guess my first question is, if I wasn't able to record that, how the heck would have have figured it out? Where in the office visual basic editor would it tell me that the object I'm looking for is called ActiveDocument? Because if I can find that, then maybe I can find the object for the monthly calendar.
thanks in advance.
-
MSDN is a good source of information for VBA stuff.
Just search for Outlook Automation on MSDN.
-
FileName:="Doc3.htm"
:= ?
What's := doing in a VB script? Different VB flavour for MSOffice?
-
@dhromed said:
FileName:="Doc3.htm"
:= ?
What's := doing in a VB script? Different VB flavour for MSOffice?:= is the syntax for named parameters in VB. (this is an IDispatch feature in COM)
-
@tofu said:
So I guess my first question is, if I wasn't able to record that, how the heck would have have figured it out? Where in the office visual basic editor would it tell me that the object I'm looking for is called ActiveDocument? Because if I can find that, then maybe I can find the object for the monthly calendar.
Here's a good place to start:
and here...
and here...
and here...
and here...
I will warn you, however, that I don't see this being easy. I didn't see a method to save the calendar as HTML, and I didn't see an object for the calendar in the object model either.
Good luck, Outlook automation is a PITA. The object model itself is a big WTF!