mperrah
09-11-2007, 01:40 AM
I'm making a help file style userform.
A sheet (HelpSheet) has the contents used for the form.
One column has the labels and another the topics.
I want to add a picture (screen capture) for each topic (15 items)
The first column on the helpsheet is the label
second column the topic and the third column I have pasted the image.
On the userform I have added an image control (Image1)
Below is the code I am working on.
not sure how to embed the images.
Do I need to save the images in a directory (folder)
and have name and path stored in column 3 that the sub calls,
instead of the actual image in the column?
I'm very new to userforms...
Private Sub UpdateForm()
ComboBoxTopics.ListIndex = CurrentTopic - 1
Me.Caption = HelpFormCaption & _
" (" & CurrentTopic & " of " & TopicCount & ")"
With LabelText
.Caption = HelpSheet.cells(CurrentTopic, 2)
.AutoSize = False
.Width = 336
.AutoSize = True
End With
With Frame1
.ScrollHeight = LabelText.Height + 5
.ScrollTop = 1
End With
With Image1
.Picture = HelpSheet.cells(CurrentTopic, 3) 'need help here
End With
If CurrentTopic = 1 Then
NextButton.SetFocus
ElseIf CurrentTopic = TopicCount Then
PreviousButton.SetFocus
End If
PreviousButton.Enabled = CurrentTopic <> 1
NextButton.Enabled = CurrentTopic <> TopicCount
End Sub
A sheet (HelpSheet) has the contents used for the form.
One column has the labels and another the topics.
I want to add a picture (screen capture) for each topic (15 items)
The first column on the helpsheet is the label
second column the topic and the third column I have pasted the image.
On the userform I have added an image control (Image1)
Below is the code I am working on.
not sure how to embed the images.
Do I need to save the images in a directory (folder)
and have name and path stored in column 3 that the sub calls,
instead of the actual image in the column?
I'm very new to userforms...
Private Sub UpdateForm()
ComboBoxTopics.ListIndex = CurrentTopic - 1
Me.Caption = HelpFormCaption & _
" (" & CurrentTopic & " of " & TopicCount & ")"
With LabelText
.Caption = HelpSheet.cells(CurrentTopic, 2)
.AutoSize = False
.Width = 336
.AutoSize = True
End With
With Frame1
.ScrollHeight = LabelText.Height + 5
.ScrollTop = 1
End With
With Image1
.Picture = HelpSheet.cells(CurrentTopic, 3) 'need help here
End With
If CurrentTopic = 1 Then
NextButton.SetFocus
ElseIf CurrentTopic = TopicCount Then
PreviousButton.SetFocus
End If
PreviousButton.Enabled = CurrentTopic <> 1
NextButton.Enabled = CurrentTopic <> TopicCount
End Sub