Results 1 to 8 of 8

Thread: How to post bullet into correct column

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2013
    Posts
    10

    How to post bullet into correct column

    Hi guys, I am writing an app where I want to insert bullets into a Word table consisting of 40 columns. The bullets should appear in the correct column depending on some number I am using. I was thinking of using a Word document as the data source and performing a Mail Merge into the template containing the table. Is it possible to do this by creating a field in vb that has a concantenation of the tab character ( I believe its is chr(9)) the correct number of times and at the end of this is the bullet (chr(183). For example, varToInsert=10*chr(9) & chr(183), and this variable becomes the mergefield in the target document which resides in the first column for each row.

    Can anyone help out?

    Thanks in advance

    Tim Christopher.

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: How to post bullet into correct column

    If you are putting information into a TABLE in MS Word, you would use "table.Cell(x,y)"

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2013
    Posts
    10

    Re: How to post bullet into correct column

    Yes that is the way to add data into a table but my query was how do I get a bullet to appear in the correct column of the table. For example if for row 1 the bullet should appear in column 13 and row 2 in column 21, can I create a field with this information that is used as a mergefield in Word, placed in the first column and when the mail merge is done the bullet jumps to the correct position?

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: How to post bullet into correct column

    guess I am not understanding. if you want a bullet (assuming text here) to appear in column 13 in a Word Table, you don't need tabs to do it. oTable.Cell(irow,13).range.text = mybullet

    And, because what you seem to be doing is using VBA for Word, not VB6, you may want to post this in the Office Development Forum instead of here...expecially seeing as how you are talking about mail merging.

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2013
    Posts
    10

    Re: How to post bullet into correct column

    thanks Sam for the help. I might try the other forum.

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2013
    Posts
    10

    How to post bullet into correct column

    Hi everyone. I am righting a small app where I want to create a mailmerge in Word 2016. My target document is a table with about 30 columns, that looks like the following:

    Staff Level 1 Level 2 Level 3 Level 4 Level 5 Level 6
    John •
    Sam •
    Rita •

    Where the dot gets inserted depends on a number for each person based on their performance. Can I insert the information in the data source (Word or Excel file) about where to place the dot? I am thinking that the information contains how many columns to tab in the target file and the mergefield is always in the first column to begin with.

    Thanks in advance

    Time Christopher

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How to post bullet into correct column

    i would think for a mailmerge you would have to put the bullet into the appropriate field for the table in the data source, before the merge

    it would be possible to do this by vba code, just prior to running the mailmerge
    the column with the number does not need to be displayed in the merge document

    edit: change of mind, you can do this by using word field in all of the level columns, if level mergefield = 1 then bullet in first column etc, tested works correctlyName:  clipic.jpg
Views: 97
Size:  27.0 KB
    ignore the fieldnames, i just used an existing datasource for testing
    Last edited by westconn1; Oct 15th, 2017 at 06:50 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    New Member
    Join Date
    Dec 2013
    Posts
    10

    Re: How to post bullet into correct column

    Thanks guys for the help

Posting Permissions

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



Click Here to Expand Forum to Full Width