add text from file...

Posted on 2012-08-14
Last Modified: 2012-09-17
Hi I want somehow  the simplest way do this.

1. Search in textfile. ( Can call it .ini .txt .csv or whatever... )
The textfile will have this contet

13/8      Kaj
14/8      Uno
15/8      Estelle
15/8      Stella
16/8      Brynolf
17/8      Valter
17/8      Verner
18/8      Ellen
18/8      Lena
19/8      Magnus
19/8      Måns
20/8      Bernhard
20/8      Bernt
21/8      Jon
21/8      Jonna
22/8      Henrietta
22/8      Henrika
23/8      Signe
23/8      Signhild
24/8      Bartolomeus
25/8      Louise
25/8      Lovisa
26/8      Östen
27/8      Raoul
27/8      Rolf
28/8      Gurli
28/8      Leila
29/8      Hampus
29/8      Hans
30/8      Albert
30/8      Albertina
31/8      Arvid
31/8      Vidar

What I would like to do is search for todays date. 14/8 (14/8      Uno) and then write out "Uno" to a powerpoint textbox or something like that...

So I want the powerpoint to every days namedays added...

The code can be done in VB or i .bat file...
Question by:kavvis
    LVL 23

    Accepted Solution

    Try this vba

    Sub getText_Today()
    Dim iFileNum As Integer
    Dim sFileName As String
    Dim strText As String
    Dim strTest As String
    Dim ipos As Integer
    ' change the path here
    sFileName = Environ("USERPROFILE") & "\Desktop\data.txt"
    iFileNum = FreeFile()
    strTest = CStr(Day(Now) & "/" & Month(Now))
    Open sFileName For Input As iFileNum
    Do While Not EOF(iFileNum)
    Line Input #iFileNum, strText
    If Left(strText, 4) = strTest Then
    ipos = InStrRev(strText, " ")
    ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange = Mid(strText, ipos + 1)
    Exit Do
    End If
    End Sub

    Author Closing Comment

    Works perfect.. thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    This video teaches viewers how to add simple and professional themes to their slides.
    The viewer will learn how to edit the master slide. They will also learn how to combine multiple themes into one master slide to use them in their presentation.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now