![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I need to take a calendar in Outlook 2003 and basically export it to a
webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
Ads |
#2
|
|||
|
|||
![]()
Have you explored the options here?
Calendar Tools for Microsoft Outlook: http://www.slipstick.com/addins/calendar.htm#print What's the code that doesn't work for you? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: I need to take a calendar in Outlook 2003 and basically export it to a webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
#3
|
|||
|
|||
![]()
i get a WebPub problem when i run her code.
"Eric Legault [MVP - Outlook]" wrote: Have you explored the options here? Calendar Tools for Microsoft Outlook: http://www.slipstick.com/addins/calendar.htm#print What's the code that doesn't work for you? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: I need to take a calendar in Outlook 2003 and basically export it to a webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
#4
|
|||
|
|||
![]()
Can you be more specific? Can you show your code please, or provide a link
to the original source code? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: i get a WebPub problem when i run her code. "Eric Legault [MVP - Outlook]" wrote: Have you explored the options here? Calendar Tools for Microsoft Outlook: http://www.slipstick.com/addins/calendar.htm#print What's the code that doesn't work for you? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: I need to take a calendar in Outlook 2003 and basically export it to a webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
#5
|
|||
|
|||
![]()
sorry.
Sub cmdPublishCalendar_Click Const olFolderCalendar = 9 ' #### BEGIN USER OPTIONS #### ' Target folder or URL strTarget = "target here" ' Title for top of calendar strTitle = "" ' Background graphic strGraphicPath = "C:\Winnt\Santa Fe Stucco.bmp" ' Use graphic Y/N? blnUseGraphic = False ' number of months to publish intMonths = 12 ' print user's default Calendar blnPrintDefaultCal = False ' path to other calendar; only valid ' if blnPrintDefaultCal = False strCalFolderPath = "Personal Folders\Calendar" ' ##### END USER OPTIONS #### ' if trailing \, strip it If Right(strTarget, 1) = "\" Then strTarget = Left(strTarget, Len(strTarget) - 1) End If 'Create instances Outlook, WebPub and fso On Error Resume Next Set oOutlApp = CreateObject("Outlook.Application") If oOutlApp Is Nothing Then MsgBox "Could not access Outlook - shutting down" Else Set oWebPub = CreateObject("InternetExplorer.Application") 'WebPub.cWebPub If oWebPub Is Nothing Then MsgBox "Could not access WebPub - Shutting down" Else Set fso = CreateObject("Scripting.FileSystemObject") If fso Is Nothing Then MsgBox "Could not access FileSystemObject - shutting down" Set oWebPub = Nothing Set oOutlApp = Nothing Exit Sub End If ' Navigate to folder to be published If blnPrintDefaultCal Then Set objNS = oOutlApp.GetNamespace("MAPI") Set objCalFolder = objNS.GetDefaultFolder(olFolderCalendar) Else Set objCalFolder = GetMAPIFolder(strCalFolderPath) End If If objCalFolder Is Nothing Then MsgBox "Could not get Calendar folder - shutting down" Else Set objExpl = oOutlApp.Explorers.Add(objCalFolder, 2) objExpl.Activate 'Calculate the first and last days of the month dteStart = CDate(Month(Date) & "/1/" & Year(Date)) dteEnd = DateAdd("m", intMonths, dteStart) 'Add a month dteEnd = DateAdd("d", -1, dteEnd) 'Subtract a day ' remove old version of calendar ' so you can publish unattended intPos = InStrRev(strTarget, "\") strCalFile = Mid(strTarget, intPos + 1) strCalFile = strTarget & "\" & strCalFile & ".htm" If fso.FileExists(strCalFile) Then fso.DeleteFile strCalFile End If 'Publish calendar to strTarget oWebPub.Create CStr(strTitle), _ CStr(strGraphicPath), _ CBool(blnUseGraphic ), _ CDate(dteStart), _ CDate(dteEnd), _ True, _ True, _ CStr(strTarget) 'WebPub.Create method parameters: 'sTitle - Title displayed at the top of the page 'sGraphic - Path to a graphic file to use for BACKGROUND ' attribute 'bUseGraphic - True=Use 'sGraphic' param, False=Ignore 'dtStartDate - Start of date range to publish 'dtEndDate - End of date range to publish 'bDetails - Publish appointment details 'bShowInBrowser - Display in default browser after publishing 'sSiteName - Local path to store published calendar If Not objExpl Is Nothing Then objExpl.Close End If End If End If End If 'Release objects Set oWebPub = Nothing Set oOutlApp = Nothing Set fso = Nothing End Sub Function GetMAPIFolder(strName) Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") arrName = Split(strName, "\") Set objFolders = objNS.Folders blnFound = False For I = 0 To UBound(arrName) For Each objFolder In objFolders If objFolder.Name = arrName(I) Then Set objFolders = objFolder.Folders blnFound = True Exit For Else blnFound = False End If Next If blnFound = False Then Exit For End If Next If blnFound = True Then Set GetMAPIFolder = objFolder End If Set objApp = Nothing Set objNS = Nothing Set objFolder = Nothing Set objFolders = Nothing Set objExpl = Nothing End Function "Eric Legault [MVP - Outlook]" wrote: Can you be more specific? Can you show your code please, or provide a link to the original source code? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: i get a WebPub problem when i run her code. "Eric Legault [MVP - Outlook]" wrote: Have you explored the options here? Calendar Tools for Microsoft Outlook: http://www.slipstick.com/addins/calendar.htm#print What's the code that doesn't work for you? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: I need to take a calendar in Outlook 2003 and basically export it to a webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
#6
|
|||
|
|||
![]()
Is oWebPub Nothing when you create it? If so, you may not have the Microsoft
Web Browser Control installed. Regardless, I don't think that's the API you want to use to publish to a web server. For starters, that object doesn't even have a Create method. You may want to use the Microsoft Internet Transfer Control or another API to publish to a web site. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: sorry. Sub cmdPublishCalendar_Click Const olFolderCalendar = 9 ' #### BEGIN USER OPTIONS #### ' Target folder or URL strTarget = "target here" ' Title for top of calendar strTitle = "" ' Background graphic strGraphicPath = "C:\Winnt\Santa Fe Stucco.bmp" ' Use graphic Y/N? blnUseGraphic = False ' number of months to publish intMonths = 12 ' print user's default Calendar blnPrintDefaultCal = False ' path to other calendar; only valid ' if blnPrintDefaultCal = False strCalFolderPath = "Personal Folders\Calendar" ' ##### END USER OPTIONS #### ' if trailing \, strip it If Right(strTarget, 1) = "\" Then strTarget = Left(strTarget, Len(strTarget) - 1) End If 'Create instances Outlook, WebPub and fso On Error Resume Next Set oOutlApp = CreateObject("Outlook.Application") If oOutlApp Is Nothing Then MsgBox "Could not access Outlook - shutting down" Else Set oWebPub = CreateObject("InternetExplorer.Application") 'WebPub.cWebPub If oWebPub Is Nothing Then MsgBox "Could not access WebPub - Shutting down" Else Set fso = CreateObject("Scripting.FileSystemObject") If fso Is Nothing Then MsgBox "Could not access FileSystemObject - shutting down" Set oWebPub = Nothing Set oOutlApp = Nothing Exit Sub End If ' Navigate to folder to be published If blnPrintDefaultCal Then Set objNS = oOutlApp.GetNamespace("MAPI") Set objCalFolder = objNS.GetDefaultFolder(olFolderCalendar) Else Set objCalFolder = GetMAPIFolder(strCalFolderPath) End If If objCalFolder Is Nothing Then MsgBox "Could not get Calendar folder - shutting down" Else Set objExpl = oOutlApp.Explorers.Add(objCalFolder, 2) objExpl.Activate 'Calculate the first and last days of the month dteStart = CDate(Month(Date) & "/1/" & Year(Date)) dteEnd = DateAdd("m", intMonths, dteStart) 'Add a month dteEnd = DateAdd("d", -1, dteEnd) 'Subtract a day ' remove old version of calendar ' so you can publish unattended intPos = InStrRev(strTarget, "\") strCalFile = Mid(strTarget, intPos + 1) strCalFile = strTarget & "\" & strCalFile & ".htm" If fso.FileExists(strCalFile) Then fso.DeleteFile strCalFile End If 'Publish calendar to strTarget oWebPub.Create CStr(strTitle), _ CStr(strGraphicPath), _ CBool(blnUseGraphic ), _ CDate(dteStart), _ CDate(dteEnd), _ True, _ True, _ CStr(strTarget) 'WebPub.Create method parameters: 'sTitle - Title displayed at the top of the page 'sGraphic - Path to a graphic file to use for BACKGROUND ' attribute 'bUseGraphic - True=Use 'sGraphic' param, False=Ignore 'dtStartDate - Start of date range to publish 'dtEndDate - End of date range to publish 'bDetails - Publish appointment details 'bShowInBrowser - Display in default browser after publishing 'sSiteName - Local path to store published calendar If Not objExpl Is Nothing Then objExpl.Close End If End If End If End If 'Release objects Set oWebPub = Nothing Set oOutlApp = Nothing Set fso = Nothing End Sub Function GetMAPIFolder(strName) Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") arrName = Split(strName, "\") Set objFolders = objNS.Folders blnFound = False For I = 0 To UBound(arrName) For Each objFolder In objFolders If objFolder.Name = arrName(I) Then Set objFolders = objFolder.Folders blnFound = True Exit For Else blnFound = False End If Next If blnFound = False Then Exit For End If Next If blnFound = True Then Set GetMAPIFolder = objFolder End If Set objApp = Nothing Set objNS = Nothing Set objFolder = Nothing Set objFolders = Nothing Set objExpl = Nothing End Function "Eric Legault [MVP - Outlook]" wrote: Can you be more specific? Can you show your code please, or provide a link to the original source code? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: i get a WebPub problem when i run her code. "Eric Legault [MVP - Outlook]" wrote: Have you explored the options here? Calendar Tools for Microsoft Outlook: http://www.slipstick.com/addins/calendar.htm#print What's the code that doesn't work for you? -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mike Fielden" wrote: I need to take a calendar in Outlook 2003 and basically export it to a webpage (.htm) I am using Vb6 to do this. I saw some code on Sue's page but that doesnt seem to work with Outlook '03. Can someone please help? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Publishing calender | Dave | Outlook - Calandaring | 0 | July 7th 06 08:34 AM |
Publishing wizard not available | DarthBillgr | Add-ins for Outlook | 0 | June 29th 06 07:05 PM |
Outook 2003 Publishing schedule | Tom Parke | Outlook - Calandaring | 0 | May 28th 06 06:06 PM |
Publishing Outlook Form Error? | [email protected] | Outlook - Using Forms | 1 | April 7th 06 12:30 AM |
Publishing Outlook Form Error? | BigFoot | Outlook - Using Forms | 0 | March 20th 06 03:41 PM |