Form Field

JackMDaniels

New Member
Joined
Feb 10, 2014
Messages
24
Hi guys

I'm wanting to insert "v." into the textbox supporting "Version", I'd like to keep it editable but have it come up every time with the form field, any suggestions? :)

Note this is for PPT not excel, but there's no VBA for PPT forum

Code:
Private Sub txtVersion_Change()


End Sub


Private Sub UserForm_Activate()
Dim Sld             As Slide
Dim SldM            As Master
Dim StrContainer    As String
Dim Shp             As Shape


With cmbClassification
    .AddItem " ", 0
    .AddItem "Public", 1
    .AddItem "For internal use", 2
    .AddItem "Confidential", 3
    .AddItem "Secret", 4
End With


Set Sld = ActivePresentation.Slides("Slide90")
    For Each Shp In Sld.Shapes
        If Shp.Type = msoTable Then
            StrContainer = Shp.Table.Cell(1, 2).Shape.TextFrame.TextRange.Text
            If InStr(1, StrContainer, "/") <> 0 Then
                Me.txtVersion = Trim(Left(StrContainer, InStr(1, StrContainer, "/") - 1))
                Me.txtStatus = Trim(Right(StrContainer, Len(StrContainer) - InStr(1, StrContainer, "/")))
            End If
            Me.txtDate = Shp.Table.Cell(2, 2).Shape.TextFrame.TextRange.Text
            Me.txtOwner = Shp.Table.Cell(3, 2).Shape.TextFrame.TextRange.Text
            Me.txtCreator = Shp.Table.Cell(4, 2).Shape.TextFrame.TextRange.Text
            Me.txtFunction = Shp.Table.Cell(5, 2).Shape.TextFrame.TextRange.Text
            Me.txtApprover = Shp.Table.Cell(6, 2).Shape.TextFrame.TextRange.Text
            Me.txtDocID = Shp.Table.Cell(7, 2).Shape.TextFrame.TextRange.Text
            Me.txtDocLocation = Shp.Table.Cell(8, 2).Shape.TextFrame.TextRange.Text
            Exit For
        End If
    Next
Set Sld = Nothing


Set SldM = ActivePresentation.SlideMaster
    StrContainer = SldM.Shapes(26).TextFrame.TextRange.Text
    StrContainer = Right(StrContainer, Len(StrContainer) - 23)
    If InStr(1, StrContainer, " - ") > 5 Then
        Me.txtFileName = Trim(Left(StrContainer, InStr(1, StrContainer, " - ") - 1))
    End If
    Me.cmbClassification = SldM.Shapes(28).TextFrame.TextRange.Text
Set SldM = Nothing


End Sub
 

Forum statistics

Threads
1,085,467
Messages
5,383,873
Members
401,859
Latest member
tomahawk61

Some videos you may like

This Week's Hot Topics

Top