Results 1 to 2 of 2
  1. #1
    Elsie is offline Novice
    Windows 8 Office 365
    Join Date
    Jan 2023
    Posts
    1

    Adding 2 Separate Tables

    I am trying to add 2 tables into my code for an automate email. However, the result comes out as a table in a table with no borders. I am unable to get them separated with borders.
    The following is my result and syntax :




    Click image for larger version. 

Name:	Annotation 2023-02-01 091930.png 
Views:	14 
Size:	9.2 KB 
ID:	49602

    Code:
     myitem.Display
     
      Set ins = oOutlook.ActiveInspector
     
      Set document = ins.WordEditor
      Set Word = document.Application
      Set selection = Word.selection
      
        selection.TypeText Text:="Dear Requester,"
        selection.TypeParagraph
        selection.TypeParagraph
       
        With selection
        .Font.Bold = True
        End With
        selection.TypeText Text:="Please confirm that quotation of chosen vendor is suitable before proceeding with PR creation."
        selection.TypeParagraph
        selection.TypeParagraph
     
    'add table here
    Set objTable = selection.Tables.Add(Range:=selection.Range, NumRows:=3, NumColumns:=2)
        objTable.Borders.OutsideLineStyle = wdLineStyleSingle
        objTable.Borders.OutsideLineWidth = wdLineWidth150pt
        objTable.Borders.OutsideColor = wdColorBlack
     
        objTable.Cell(1, 1).Range.Text = "Initial quote :"
        objTable.Cell(1, 2).Range.Text = " "
        objTable.Cell(2, 1).Range.Text = "Discount rate :"
        objTable.Cell(2, 2).Range.Text = ""
        objTable.Cell(3, 1).Range.Text = "Final quote :"
        objTable.Cell(2, 2).Range.Text = ""
     
        selection.TypeParagraph
        selection.TypeParagraph
       
    Set objTable2 = selection.Tables.Add(Range:=selection.Range, NumRows:=2, NumColumns:=2)
        objTable2.Borders.OutsideLineStyle = wdLineStyleSingle
        objTable2.Borders.OutsideLineWidth = wdLineWidth150pt
        objTable2.Borders.OutsideColor = wdColorBlack
     
        objTable2.Cell(1, 1).Range.Text = "Last spend on year 2020 :"
        objTable2.Cell(1, 2).Range.Text = " "
        objTable2.Cell(2, 1).Range.Text = "Incremental increase percentage :"
        objTable2.Cell(2, 2).Range.Text = ""

    The result that I want is:


    Click image for larger version. 

Name:	Annotation 2023-02-01 091930.png 
Views:	13 
Size:	3.6 KB 
ID:	49601





  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Cross post https://stackoverflow.com/questions/...eparate-tables

    Where is rest of code: declaring variables, what is myitems.Display, how do you output tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Separate tables or a set of unified tables?
    By fret hack in forum Database Design
    Replies: 2
    Last Post: 12-21-2017, 12:48 PM
  2. Adding query run date to a separate table
    By Maverick28 in forum Queries
    Replies: 2
    Last Post: 11-06-2017, 09:18 AM
  3. Adding dates to an invoice using separate form
    By gebmiller1984 in forum Forms
    Replies: 1
    Last Post: 11-12-2015, 02:42 PM
  4. Replies: 10
    Last Post: 05-22-2013, 02:56 PM
  5. adding record by using separate form
    By jacek.w.bak in forum Forms
    Replies: 1
    Last Post: 09-11-2011, 06:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums