Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PrivateProfileString (Office 2003/PowerPoint)

    Hi

    I am attempting to pick up information from an ini file and populate it in a userform in the PowerPoint environment. It appears that System.PrivateProfileString does not register in PowerPoint - is there another way to retrieve this information?

    Many thanks
    Jack

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PrivateProfileString (Office 2003/PowerPoint)

    Here is some old code to read from an ini file. Copy the code from the attached text file into a module. The first part (Private Declare Function ...) must be before all procedures and functions in the module. You can then use it like this:

    Dim strSetting As String
    strSetting = ReadIniFile("F:Test.ini", "Window", "Left")

    or

    strSetting = ReadIniFile("F:Test.ini", "Window", "Left", 200)

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: PrivateProfileString (Office 2003/PowerPoint)

    Incidentally, "System" is a Word object. You can add a reference to the Word object library to your PowerPoint project, which may allow you to use the System object and its methods. I haven't tested this, but often this works. On the other hand, if you plan to share the presentation with others, it can introduce vexing problems for those who do not have the same version of Word as you do.

  4. #4
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PrivateProfileString (Office 2003/PowerPoint)

    Morning Hans

    Only just got around to this PowerPoint ini file thing, after my Excel template fiasco. I've incorported the code suggested in the attachment, and as always, it's working like a dream.

    Many thanks
    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •