Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2018, 01:33 PM
faustino909 faustino909 is offline Removing spaces in activedocument after empty bookmarks Windows 10 Removing spaces in activedocument after empty bookmarks Office 2016
Novice
Removing spaces in activedocument after empty bookmarks
 
Join Date: Jul 2018
Posts: 3
faustino909 is on a distinguished road
Default figured it out.

I did not know I only needed ONE String and ONE Bookmark and just kept appending all data gathered (button caption, textbox, checkbox caption etc)



So I just created 1 bookmark and just kept appending to same string:
partial code, where SmokingData0 is the string attached to one bookmark. So I just kept adding to same string.

Code:
Dim SmokingData0 As Range
 
    Set SmokingData0 = ActiveDocument.Bookmarks("BMsmokingData0").Range
    
    
    If CBsmoking.Value = True Then
        SmokingData0.Text = Me.CBsmoking.Caption & "  "
    End If
    
    If CBcigarettes.Value = True Then
       SmokingData0.Text = "Cigarette smoking since " & TBcigaretteSince.Text & ".  "
        If OBcigaretteStill.Value = True Then
            SmokingData0.Text = SmokingData0.Text & "Currently smokes up to " & TBcigaretteStill.Text & ".  "
            ElseIf OBcigaretteStill.Value = False Then
                If Not TBcigaretteStop.Text = "" Then
                SmokingData0.Text = SmokingData0.Text & "Stopped since " & TBcigaretteStop.Text & ".  "
                End If
        End If
    End If
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing spaces in activedocument after empty bookmarks Removing Empty Brackets In Batch Agog Word VBA 16 07-16-2018 05:39 AM
Removing spaces in activedocument after empty bookmarks How to find and replace random empty spaces in beginning of lines? Pauliina Word 4 05-24-2018 10:01 PM
Removing spaces in activedocument after empty bookmarks removing spaces in cell Tonykiwi Excel 4 11-06-2016 09:30 PM
Word-Help with removing unwanted spaces in text greshoff Word 9 12-30-2011 03:24 PM
Removing spaces in activedocument after empty bookmarks double spaces in field ref (bookmarks) GLENCOE Word 3 10-25-2011 07:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft