Excel to PDF VBA writing a code to indicate new line within same box

cskelk

New Member
Joined
Jun 9, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have Data from Excel, that I am writing VBA to insert Data onto a fillable PDF Box Here is the specific code referring to my Problem:

Application.SendKeys "Academy ID - ", True
Application.SendKeys AcademyID, True
Application.Wait Now + 0.00001

'Need to insert code so I can "Enter" and create new line

Application.SendKeys "Weapon Serial Number - ", True
Application.SendKeys WeaponSerial, True
Application.Wait Now + 0.00003

I need to insert code so it should read AcademyID "New Line" WeaponSerial

Any help would be greatly appreciated.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You don't want to use the ENTER key in SendKeys to perform a function. It will prevent you from using the ENTER key
for anything else.

Better choice is to use a Command Button that you can click.
 
Upvote 0
It worked on the fillable PDF I tried it on. Maybe it depends on how the form is created. Does switching 13 with 10 change anything?
 
Upvote 0
Google SENDKEYS and review the list of variable numbers that can be used for all the different keys.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top