Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2020, 04:03 PM
Guessed's Avatar
Guessed Guessed is offline Creating a Word Document in vba from an Access Function Windows 10 Creating a Word Document in vba from an Access Function Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default


Don't use a selection object for this. Assuming there is no initial content in the new doc you could remove those pesky .Selection lines and replace it with

.Range.Text = "Station Name" & vbCr & "Programme Number" & vbCr & "Programme Date" & vbCr
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 05-13-2020, 01:19 AM
jcc285 jcc285 is offline Creating a Word Document in vba from an Access Function Windows 10 Creating a Word Document in vba from an Access Function Office 2016
Novice
Creating a Word Document in vba from an Access Function
 
Join Date: Aug 2014
Location: UK
Posts: 4
jcc285 is on a distinguished road
Default Creating a Word Document in vba from an Access Function

Thank you for your reply. I have tried this route before however when the Document is produced the text moves to the bottom of the page. I guess I need to do 'something' to position the table on the page but I have no idea what?

I've attached an image of the current result having replaced the .selection coding with:-

Code:
With oWordDoc
  .PageSetup.Orientation = wdOrientLandscape
  .Range.Text = "Station Name" & vbCr & "Programme Number" & vbCr & "Programme                      Date" & vbCr
End With
Attached Images
File Type: jpg Heading at bottom.jpg (115.3 KB, 13 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Word Document in vba from an Access Function How to Open a Word Document from ACCESS VBA PosseJohn Word VBA 3 12-06-2013 04:33 PM
Creating a graph for Future Value function (FV function) bmoody Excel 2 11-06-2013 10:52 AM
importing Access data to a Word document WayneCusack Word VBA 2 12-24-2012 12:26 AM
Creating a Word Document in vba from an Access Function Access to Word, Creating a list from multiple records daymaker Mail Merge 9 03-14-2012 06:37 AM
Protecting Word Document by restricting access permissions! user Word 0 11-20-2008 01:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:15 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