Need help ASAP (1 Viewer)

Mattymatt79

Paintball Guy
Local time
Today, 02:18
Joined
Apr 23, 2002
Messages
46
ok, this code works, well sort of
i wrote a few days ago about moving stuff from access to powerpoint
well i figured that making a report, making the report richtext and then taking the richtext word file and making a powerpoint slide... it works but not really
heres the code
it only works for the first three slides and then after that it does nothing
any suggestions?


Option Compare Database

'------------------------------------------------------------
' OutputMPFReport
'
'------------------------------------------------------------
Function OutputMPFReport()
On Error GoTo OutputMPFReport_Err
' change to rich text format

DoCmd.OutputTo acReport, "MPF1", "RichTextFormat(*.rtf)", "H:\NewDatabase\MPF1.rtf", False, ""
DoCmd.OutputTo acReport, "DEPORD", "RichTextFormat(*.rtf)", "H:\NewDatabase\DEPORD.rtf", False, ""
DoCmd.OutputTo acReport, "FAST", "RichTextFormat(*.rtf)", "H:\NewDatabase\FAST.rtf", False, ""
DoCmd.OutputTo acReport, "MSC", "RichTextFormat (*.rtf)", "H:\NewDatabase\MSC.rtf", False, ""
DoCmd.OutputTo acReport, "RFF", "RichTextFormat (*.rtf)", "H:\NewDatabase\RFF.rtf", False, ""
DoCmd.OutputTo acReport, "SORTS", "RichTextFormat (*.rtf)", "H:\NewDatabase\SORTS.rtf", False, ""
DoCmd.OutputTo acReport, "Exercise1", "RichTextFormat (*.rtf)", "H:\NewDatabase\Exercise1.rtf", False, ""
DoCmd.OutputTo acReport, "GLOBALPOSTURE", "RichTextFormat (*.rtf)", "H:\NewDatabase\GlobalPosture.rtf", False, ""
DoCmd.OutputTo acReport, "JTF", "RichTextFormat (*.rtf)", "H:\NewDatabase\JTF.rtf", False, ""
DoCmd.OutputTo acReport, "MEU", "RichTextFormat (*.rtf)", "H:\NewDatabase\MEU.rtf", False, ""
DoCmd.OutputTo acReport, "MPF", "RichTextFormat (*.rtf)", "H:\NewDatabase\MPF.rtf", False, ""
DoCmd.OutputTo acReport, "OperationsTEMPLATE", "RichTextFormat (*.rtf)", "H:\NewDatabase\Operations.rtf", False, ""



' opening powerpoint design master slide

Call Shell("C:\Progra~1\Micros~1\Office\Powerpnt.exe H:\NewDatabase\datatemp.ppt", 1)


OutputMPFReport_Exit:
Exit Function

OutputMPFReport_Err:
MsgBox Error$
Resume OutputMPFReport_Exit

'---------------------------------------------
' Macro For Slide Insertion 5/1/02 by Cpl King
'---------------------------------------------

' For Insertion
' Each slide needs to be converted from rtf file and then linked and inserted.
' This needs to be done everytime a new slide is made
' Also this will create a new blank slide for the rtf file to be added to


ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\DEPORD.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 126#
.Top = 183.5
.Width = 468#
.Height = 173#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=2, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\Exercise1.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 242.25
.Top = 110#
.Width = 235.5
.Height = 320#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=3, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\FAST.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 241.5
.Top = 110#
.Width = 236.875
.Height = 320#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=4, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\GlobalPosture.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 126#
.Top = 83.75
.Width = 468#
.Height = 372.625
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=5, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\JTF.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 126#
.Top = 76#
.Width = 468#
.Height = 388#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=6, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\MEU.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 241.5
.Top = 110#
.Width = 236.875
.Height = 320#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=7, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\MPF1.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 126#
.Top = 84#
.Width = 468#
.Height = 372.125
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=8, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\MSC.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 241.625
.Top = 110#
.Width = 236.625
.Height = 320#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=9, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\Operations.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 241.5
.Top = 110#
.Width = 237#
.Height = 320#
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=10, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\RFF.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 126#
.Top = 51.875
.Width = 468#
.Height = 436.375
End With
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=11, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="H:\NewDatabase\SORTS.rtf", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 242.625
.Top = 110#
.Width = 234.625
.Height = 320#
End With


End Function

i dont know what is going on here but blam it is pissing me off
 

fmm

Registered User.
Local time
Today, 01:18
Joined
Mar 15, 2001
Messages
76
I have no idea if this is it, but...

DoCmd.OutputTo acReport, "MPF1", "RichTextFormat(*.rtf)", "H:\NewDatabase\MPF1.rtf", False, ""
DoCmd.OutputTo acReport, "DEPORD", "RichTextFormat(*.rtf)", "H:\NewDatabase\DEPORD.rtf", False, ""
DoCmd.OutputTo acReport, "FAST", "RichTextFormat(*.rtf)", "H:\NewDatabase\FAST.rtf", False, ""
DoCmd.OutputTo acReport, "MSC", "RichTextFormat (*.rtf)", "H:\NewDatabase\MSC.rtf", False, ""
DoCmd.OutputTo acReport, "RFF", "RichTextFormat (*.rtf)", "H:\NewDatabase\RFF.rtf", False, ""


Starting with your 4th DoCmd.Output statement, there is a space between RichTextFormat and (*.rtf) where there is no space on the 1st three.
 

Mattymatt79

Paintball Guy
Local time
Today, 02:18
Joined
Apr 23, 2002
Messages
46
well, that was a problem but not the reasoning behind why it didnt work. it now created all of the rtf files this time which is a positive but it still only made 3 slides... i dont know what is wrong it still isnt working correctly
do i need to make a seperate macro for each of them and then compile every macro in to one file?
 

Users who are viewing this thread

Top Bottom