+ Reply to Thread
Results 1 to 7 of 7

Write to built in document properties with a User Form

  1. #1
    Registered User
    Join Date
    11-18-2019
    Location
    Nashua, NH
    MS-Off Ver
    Office 365
    Posts
    3

    Write to built in document properties with a User Form

    Hi all,

    Is it possible to write to the built in document properties with a User Form? I'm trying to create a form that pops up when a document is opened with two text boxes, named "Proj_num" and "Client_name".

    When the user clicks the "OK" CommandButton, I want the value in "Proj_num" to write to the built in document property "Subject", and the "Client_name" to write to the property "Company".

    Note -- I'm very new to VBA. So far I've only been able to create the form with the text boxes and the command buttons. The form pops up when the document is opened and the form closes when I click the Cancel command button, so that part is working. I need help with the code for the "OK" command button.

    Thanks!
    Tim
    Attached Images Attached Images

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Write to built in document properties with a User Form

    Welcome to the Forum TSkyla!

    I have not tested this but would be happy to do so if you provide your file (instead of a picture). The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 11-18-2019 at 02:31 PM. Reason: Had the assignments backwards!
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-18-2019
    Location
    Nashua, NH
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Write to built in document properties with a User Form

    Hi - thanks for the reply. I've tried your code and am getting an error. I've attached the file.

    Tim
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Write to built in document properties with a User Form

    Change:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and everything will work

    ... a small "slip of the tongue"

  5. #5
    Registered User
    Join Date
    11-18-2019
    Location
    Nashua, NH
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Write to built in document properties with a User Form

    Perfect, thanks!

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Write to built in document properties with a User Form

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon addreputationiconsmall.jpg below their name.

    If you solved your own problem, please provide your solution so that somebody seeing this thread in a search for the same problem will see how it was solved.

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Write to built in document properties with a User Form

    Quote Originally Posted by TSkyla View Post
    Perfect, thanks!
    ... to "6SJ", not to me, remember ... I was just/only (???) an editor ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. User form advice. Multi tab, multiple forms or VBA write form
    By Ratso in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2019, 11:16 AM
  2. ComboBox Properties in User Form
    By Himsel in forum Excel General
    Replies: 3
    Last Post: 09-26-2015, 10:06 AM
  3. Working Backwards with form fields to update document properties in Windows
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2014, 07:39 AM
  4. [SOLVED] Keep excel built in user form on top of sheet when opened
    By interested in forum Excel General
    Replies: 12
    Last Post: 11-28-2012, 08:11 AM
  5. Displaying data in a custom built user form
    By thomas.szwed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2007, 05:28 PM
  6. User Form... built in form is so close...!
    By pianoman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2006, 08:01 AM
  7. user form & control properties
    By Mike Molyneaux in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2005, 04:41 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1