Microsoft Access Cannot Follow Hyperlink Vba
I am using MS Access to generate data that creates Powerpoint slides from a template, renames and save in a folder. Powerpoint VBA -add transparent hyperlink shape on top of name in text frame using name dimensions. What I want to achieve and cannot find information on is being able to add a name and then add a transparent shape over the. FollowHyperlink not working with pdf file. Microsoft Access / VBA Forums on Bytes. Microsoft Access; Application.FollowHyperlink; Become a Registered Member (free). I am trying to figure out if there is a way to disable the warning that is received when following hyperlinks. A lot of VBA code can be acquired by using the Macro Recorder.
I am using MS Access to generate data that creates Powerpoint slides from a template, renames and save in a folder.
The data populates the 'Title' and 'Subtitle2' text boxes on the layout slide. Subtitle2 uses a recordset loop to add names per line. What I want to achieve and cannot find information on is being able to add a name and then add a transparent shape over the top that is the same dimensions of the name that will then be hyperlinked to an address that is added from the data. The next name is added and another transparent shape is added over the top of that name with the hyperlink. This method eliminates the unsightly underlines in normal hyperlinking text directly from the text. I do this manually at the moment and would like to automate this process.
Hyperlinks In Microsoft Access
I cannot find any means of using the Subtitle2 text position and size to position and size for the hyperlink shape dimensions. All text ranges refer to text frames.
Microsoft Access Cannot Follow Hyperlink Vba Code
Set pptPres = pptApp.Presentations.Open(pPath, WithWindow:=msoTrue)
'Add newppt slide from Slide Master
pptPres.Slides.Add pptPres.Slides.Count + 1, ppLayoutTitle
Set currentSlide = pptPres.Slides(1)
With rs
'Debug.Print currentSlide.Name
'Use Recordset data and fill slide txt ranges- Session Title in Title 1 shape
currentSlide.Shapes('Title 1').TextFrame.TextRange.Text = Me.SessionTitle
.MoveFirst
currentSlide.Shapes('Subtitle 2').TextFrame.TextRange.Text = '
'Set up loop to get data, used Not IsNull due to rs containing null field and creating error
While Not rs.EOF
'Populate TextRange with data use InsertAfter and line feed command to fill range
With currentSlide.Shapes('Subtitle 2').TextFrame.TextRange.InsertAfter(' ')
.Text = CStr(rs.Fields('PresName').Value) & vbCrLf
'Hyperlink Address
NameHyp = (rs.Fields('NamePath').Value) & '.pptx'
'Add shape with hyperlink
With currentSlide.Shapes.AddShape(msoShapeRectangle, 0, 0, 250, 140)
.Fill.Transparency = 1
.Line.Visible = True
.ActionSettings(ppMouseClick).Hyperlink.Address = NameHyp
End With
End With
rs.MoveNext
Wend
End With
'Save presentation in Destination folder
pptPres.SaveAs SessionPath
MsgBox 'A Session Slide has been created'
'After message box is closed, session folder opens
Application.FollowHyperlink [Folder]
Exit_Point:
rs.Close 'Close Recordset
' Keep PPT window open to edit newly created slide and ensure all is correct
'Close, quit & clear PPTX
Set pptPres = Nothing
Set pptApp = Nothing
Exit Sub
err_handler:
Call LogError(Err.Number, Err.Description, 'cmdParagraphTest_Click()')
Resume Exit_Point 'Resume to tidy all open rs and ppt files
End Sub